Page 1 of 1

Capture Alerts in a file

Posted: Sun Jul 05, 2020 11:48 pm
by ets_user
Hi,

Can we capture the alerts in a file.

For every alert generated in Nagios we need the alert message to be created in a seperate file in a folder location.

Kindly advise.

Thanks.

Re: Capture Alerts in a file

Posted: Mon Jul 06, 2020 1:07 pm
by benjaminsmith
HI,

One option is the reports, this information is available (e.g. State History, Alert History) and can be sent as a CSV file on a regular basis using the scheduled reporting feature.

You can also automate this with some scripting. For example, you can write this data to a log file using a custom event handler or you can parse the nagios.logs on a schedulable basis and write out the required data to a separate log.

Introduction to Event Handlers

Log Files:'

Code: Select all

/usr/local/nagios/var/archives
/usr/local/nagios/var/nagios.log
Hope that helps, and let me know if you have any questions.

Re: Capture Alerts in a file

Posted: Mon Jul 06, 2020 1:36 pm
by scottwilkerson
This would be easiest to use the Global Event Handlers in XI if you want to do it for every all hosts/services

https://assets.nagios.com/downloads/nag ... ios-XI.pdf