Page 1 of 1

Can NagiosXI send notification via FTP or other way?

Posted: Sat Oct 17, 2015 9:15 pm
by xpertech
For some reasons and environment, if NagiosXI not allowed to send notification via Email or SMS, is there any other way to send notification? e.g. via FTP or file sharing.

Re: Can NagiosXI send notification via FTP or other way?

Posted: Sun Oct 18, 2015 10:50 am
by jdalrymple
Notifications in Nagios are simply a command that runs at specific times.

You can definitely change that command, or even run multiple commands (on a per user basis). When configuring a contact in CCM note the configuration options host_notification_command and also service_notification_command. The commands themselves will have to be valid Nagios commands (also specified in CCM) but then they can be executed as an alternative to the default xi_notification_handler.

Re: Can NagiosXI send notification via FTP or other way?

Posted: Sun Oct 18, 2015 12:09 pm
by mp4783
You can also write this as an event handler if that's easier. Just bundle up the the commands necessary to FTP your notification into a wrapper script and be sure it outputs an informative exit status.

Re: Can NagiosXI send notification via FTP or other way?

Posted: Sun Oct 18, 2015 12:16 pm
by jdalrymple
Just be aware event handlers are commands that happen at different times (more often) than notifications. The biggest difference being event handlers are executed in HARD->SOFT switches.

Re: Can NagiosXI send notification via FTP or other way?

Posted: Sun Oct 18, 2015 12:54 pm
by mp4783
Agreed. You would essentially have to build the "when to notify" logic into the event handler itself and configure the service check appropriately.

For what it's worth, if you truly meant to ask what other ways can you use to be notified, then the answer is anything you can run at the command line.

Re: Can NagiosXI send notification via FTP or other way?

Posted: Mon Oct 19, 2015 9:47 am
by tmcdonald
All valid answers, but FTP notifications are definitely not built-in. We can help with getting the script into Nagios, but it is something you or your team would need to write.

Re: Can NagiosXI send notification via FTP or other way?

Posted: Mon Oct 19, 2015 8:17 pm
by xpertech
tmcdonald wrote:All valid answers, but FTP notifications are definitely not built-in. We can help with getting the script into Nagios, but it is something you or your team would need to write.
Thanks all the answers, would you kindly list the scripts (suppose a FTP account "user, pass" and sub-folder "nagios"), I wonder if the upload file can have a subject and body which like Email? this scripts should be write in event handler? how this event be executed?

Re: Can NagiosXI send notification via FTP or other way?

Posted: Tue Oct 20, 2015 10:05 am
by jdalrymple
xpertech wrote:would you kindly list the scripts (suppose a FTP account "user, pass" and sub-folder "nagios")
As tmcdonald said nothing is built in. You would have to generate a script yourself in-house.
xpertech wrote:I wonder if the upload file can have a subject and body which like Email? this scripts should be write in event handler?
All of the requirements you asked for are very possible as all of those items are available via macros:
https://assets.nagios.com/downloads/nag ... olist.html
You can write the scripts in any language that your machine can interpret. Be aware it would be desirable to have it called with all the proper arguments from the Nagios process so that you don't have to generate the environmentals from macros. That process is very taxing on a system with many notifications.