Продолжаю временно мучить нагиос [ Отрицательные значения в Packet loss = -66%, RTA = 593896996864.00 ms ] :) . При падении узла команда отрабатывается, но при поднятии узла ничего не происходит
На узле дергаеться contact_groups admins;
Вот примера контакта и самой группы
define contact{
contact_name xxxov
use generic-contact
alias xx zzz Y
host_notifications_enabled 1
service_notifications_enabled 1
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r,f
host_notification_options d,u,r,f,s
service_notification_commands notify-service-by-sms
host_notification_commands notify-host-by-sms
email xxx@sd.sd
can_submit_commands 1
}
define contactgroup{
contactgroup_name admins
alias Admins
members xxxov
}
И сам notify .кстати приелетает только при падении узла инфа
define command{
command_name notify-host-by-sms
command_line /usr/lib64/nagios/plugins/smsend.pl "$NOTIFICATIONTYPE$ Host-$HOSTNAME$ is $HOSTSTATE$"
}
define command{
command_name notify-service-by-sms
command_line /usr/lib64/nagios/plugins/smsend.pl "$NOTIFICATIONTYPE$ Service-$HOSTNAME$/$SERVICEDESC$ is $SERVICESTATE$"
}
Сама команда довольно топорная и просто дергает url gsm шлюза для отправки смс
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
use Text::Unidecode;
my $e = 'xxcxc343';
my $content = $ARGV[0];
$content = unidecode($content);
$content =~ s/ /_/g;
$content =~ s/\\/_/g;
$content =~ s/\//_/g;
$content =~ s/:/_/g;
$content =~ s/\.\./_/g;
my $out = `/usr/lib64/nagios/plugins/check_http -H 10.x.x.x -u "http://10.x.x.x/cgi/WebCGI?1500101=account=voipgsm_yeastar8&password=blabla&port=3&destination=$e&content=$content"`;
Nagios Core 3.5.1