Ok, I want to change the way i handle on-call rotation so I don't have to "apply configuration" in nagios every day.
Is there a way to call and use the XI Notification handler from command line? Like if I know the contact and all the other information, can I pass it onto some php to send the alert?
NagiosXI Alert handler
NagiosXI Alert handler
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
Re: NagiosXI Alert handler
It is funny you ask this as Scott just wrote new php notification handlers that use the XI mail settings but can be used with core contacts. You could create your own script that essentaily calls the new notification handler with macros of your choice (like the $CONTACTEMAIL).
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.
"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.
Re: NagiosXI Alert handler
I can definitely see this being very useful but not a perfect fit for what I wanted. I could use it, but it would remove from functionality for me. I'd like to create a script that is passed all the proper information, it figures out what XI user to actually notify and then passes that information back into XI so the user's settings are used(sms, time of day, blah blah blah)
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
Re: NagiosXI Alert handler
I guess I'm an idiot. I can just use the handle_nagioscore_notification.php script that is already being used and just wrap it with my custom script. Close this, no, keep it open, I'll update with a much better on call rotation handling then what I did in the past that is much cleaner and requires no nagios restart.
EDIT: no, this still isn't perfect...OMG, now I understand why you don't include this feature!
EDIT: no, this still isn't perfect...OMG, now I understand why you don't include this feature!
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
Re: NagiosXI Alert handler
Let me ask this question:
currently by defualt there is this command for contacts host commands in XI:
Does that one command handle email and sms? If I call that script and supply it all that information form the command line, would it obey what the user has set on their account (i.e only during certain hours, no flapping alerts, no email only sms, etc)?
currently by defualt there is this command for contacts host commands in XI:
Code: Select all
/usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification.php --notification-type=host --contact="$CONTACTNAME$" --contactemail="$CONTACTEMAIL$" --type=$NOTIFICATIONTYPE$ --escalated="$NOTIFICATIONISESCALATED$" --author="$NOTIFICATIONAUTHOR$" --comments="$NOTIFICATIONCOMMENT$" --host="$HOSTNAME$" --hostaddress="$HOSTADDRESS$" --hostalias="$HOSTALIAS$" --hostdisplayname="$HOSTDISPLAYNAME$" --hoststate=$HOSTSTATE$ --hoststateid=$HOSTSTATEID$ --lasthoststate=$LASTHOSTSTATE$ --lasthoststateid=$LASTHOSTSTATEID$ --hoststatetype=$HOSTSTATETYPE$ --currentattempt=$HOSTATTEMPT$ --maxattempts=$MAXHOSTATTEMPTS$ --hosteventid=$HOSTEVENTID$ --hostproblemid=$HOSTPROBLEMID$ --hostoutput="$HOSTOUTPUT$" --longhostoutput="$LONGHOSTOUTPUT$" --datetime="$LONGDATETIME$"2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: NagiosXI Alert handler
Kind of... It just creates an event, then the eventman cron processes these events, looks up the users settings (mail, sms, time limitations, custom message template, etc.) then the message is sent using these, if need be.BanditBBS wrote: Does that one command handle email and sms?
Re: NagiosXI Alert handler
Ok, good. I did not understand that process, now that it has been explained, I think I can get this to work rather easily. God is my dev server going to be a Frankenstein after the mods I'm testingscottwilkerson wrote:Kind of... It just creates an event, then the eventman cron processes these events, looks up the users settings (mail, sms, time limitations, custom message template, etc.) then the message is sent using these, if need be.BanditBBS wrote: Does that one command handle email and sms?
Scott, or whoever, feel free to close this. I'll post my finished new on-call handling as a new post/to the exchange when I am done.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github