Page 1 of 1

notification are sent but not recieved

Posted: Sun Mar 27, 2016 11:28 am
by bunker
hi, few weeks back i asked a question that, 'how to send http notifications from nagios', i got a pretty good answer. i created a curl command and added like below in /use/local/nagios/objects/contacts.cfg file.

Code: Select all

# 'notify-service-by-http' command definition
define command{
        command_name    notify-service-by-http
        command_line    /usr/bin/curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X POST -d '{"notification":{"host":"$HOSTADDRESS$", "service":"$SERVICEDISPLAYNAME$", "state":"$SERVICESTATE$", "host-state-type":"$SERVICESTATETYPE$", "notification-type":"$NOTIFICATIONTYPE$", "attempts":"$SERVICEATTEMPT$", "max-attempts":"$MAXSERVICEATTEMPTS$", "time":"$TIME$"}}' http://192.168.56.113:8080/things > /tmp/notification.log
        }
the curl command works fine on command line.but when i increase load to test nagios notifications then nagios.debug file shows me that contact is notified but no notification is received on the other side. again the curl command is tested before adding into commands.cfg.

any help and suggestion would be appreciated. thanks

Re: notification are sent but not recieved

Posted: Sun Mar 27, 2016 10:54 pm
by bunker
I can provide other information too, If someone needed But please help me :(

Re: notification are sent but not recieved

Posted: Mon Mar 28, 2016 9:33 am
by rkennedy
Does your output, /tmp/notification.log show anything? If not, can you add a -v to the curl so we can see the output?

Just to make sure - did you change the host/service_notification_commands to your new option? If it's firing in Nagios, then I believe the issue is somewhere with the CURL command.