notification are sent but not recieved

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.
Locked
bunker
Posts: 12
Joined: Thu Mar 10, 2016 8:00 am

notification are sent but not recieved

Post 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
bunker
Posts: 12
Joined: Thu Mar 10, 2016 8:00 am

Re: notification are sent but not recieved

Post by bunker »

I can provide other information too, If someone needed But please help me :(
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: notification are sent but not recieved

Post 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.
Former Nagios Employee
Locked