view 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
line wrap: on
line source
#!/usr/bin/perl
#
#
# Sean Engelhardt, sean.engelhardt@intevation.de
#
#
#    Copyright (C) 2015, Intevation
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
#    the argument passed to the script should be the service-name in the 
#    dash.conf from the bottledash-configuration

#!/usr/bin/perl
use LWP::UserAgent;
use Getopt::Std;

getopts ("S:s:g:h:t:l:f:u");

$ALERT = $opt_u ? "UPALERT" : "ALERT";
$SERVICE = @ARGV;

my $server_endpoint = "http://localhost:8000/updown";
my $ua = LWP::UserAgent->new;
my $req = HTTP::Request->new(POST => $server_endpoint);
$req->header('content-type' => 'x-www-form-urlencoded');
my $post_data = "service=$SERVICE&status=$ALERT";
$req->content($post_data);
my $resp = $ua->request($req);
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)