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.
Capture Alerts in a file
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Capture Alerts in a file
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:'
Hope that helps, and let me know if you have any questions.
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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Capture Alerts in a file
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
https://assets.nagios.com/downloads/nag ... ios-XI.pdf