Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
I'm having a problem when it comes to the notification commands. You see i have a script made in perl which sends tweets as alarms, if i execute it manually it works but it doesnt works when an alarm is activacted and sends the notification.
use Net::Twitter::Lite::WithAPIv1_1;
use Switch;
my $consumer_key = "";
my $consumer_secret = "";
my $access_token = "";
my $access_token_secret = "";
my $region = $ARGV[0];
my $type = $ARGV[1];
my $hostname = $ARGV[2];
my $service_desc = $ARGV[3];
my $service_out = $ARGV[4];
my $url = $url = "http://localhost.nagios.com/nagios/cgi-bin/extinfo.cgi?type=2&host=";
my $tweet = Net::Twitter::Lite::WithAPIv1_1->new(consumer_key => $consumer_key,
consumer_secret => $consumer_secret,
access_token => $access_token,
access_token_secret => $access_token_secret);
my $prepare_tweet = $type." in ".$hostname." on ".$service_desc." ( ".$service_out." ) ".$url.$hostname."&service=".$service_desc;
my $result = $tweet->update({status => $prepare_tweet});
You will need to install a package for that lib if you do not have it. What distro are you running?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
What does a standard output of the script form the cli look like?
Though probably not related, your commands above are odd:
The order of passed macros are different between the two commands - one starts with HOSTSTATE, the other starts with HOSTNAME. Additionally, The first command appends to the log (>>), while the other overwrites the log (>). Finally, the second command has an invalid path:
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.