Mercurial > bottledash
comparison doc/connect_with_mon/bottledash.alert @ 29:140c9023df7a
added important default servers
author | sean |
---|---|
date | Fri, 14 Aug 2015 15:32:57 +0200 |
parents | 7d431b779512 |
children | a43fa30655e9 |
comparison
equal
deleted
inserted
replaced
28:af280057d5fa | 29:140c9023df7a |
---|---|
18 # | 18 # |
19 # You should have received a copy of the GNU General Public License | 19 # You should have received a copy of the GNU General Public License |
20 # along with this program; if not, write to the Free Software | 20 # along with this program; if not, write to the Free Software |
21 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 21 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
22 # | 22 # |
23 # the argument passed to the script should be the service-name in the | |
24 # dash.conf from the bottledash-configuration | |
23 | 25 |
24 #!/usr/bin/perl | 26 #!/usr/bin/perl |
25 use LWP::UserAgent; | 27 use LWP::UserAgent; |
26 use Getopt::Std; | 28 use Getopt::Std; |
27 | 29 |
28 getopts ("S:s:g:h:t:l:f:u"); | 30 getopts ("S:s:g:h:t:l:f:u"); |
29 | 31 |
30 $ALERT = $opt_u ? "UPALERT" : "ALERT"; | 32 $ALERT = $opt_u ? "UPALERT" : "ALERT"; |
31 $SERVICE = $opt_g; | 33 $SERVICE = @ARGV; |
32 | 34 |
33 my $server_endpoint = "http://localhost:8000/updown"; | 35 my $server_endpoint = "http://localhost:8000/updown"; |
34 my $ua = LWP::UserAgent->new; | 36 my $ua = LWP::UserAgent->new; |
35 my $req = HTTP::Request->new(POST => $server_endpoint); | 37 my $req = HTTP::Request->new(POST => $server_endpoint); |
36 $req->header('content-type' => 'x-www-form-urlencoded'); | 38 $req->header('content-type' => 'x-www-form-urlencoded'); |