Capture Alerts in a file

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
ets_user
Posts: 78
Joined: Mon Mar 30, 2020 2:50 am

Capture Alerts in a file

Post 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.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Capture Alerts in a file

Post 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.
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!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Capture Alerts in a file

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked