Get list of actual alerts from command line ?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
fgilain
Posts: 8
Joined: Tue Nov 22, 2011 5:01 am

Get list of actual alerts from command line ?

Post by fgilain »

Hello all,

i'm looking for a simple way to get the actual alerts list from the linux command line, is there a way to get it ?

Thanks

Florent
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Get list of actual alerts from command line ?

Post by abrist »

You could grep the nagios.log file for "ALERT", "WARNING" or "CRITICAL"

Code: Select all

grep ALERT /usr/local/nagios/var/nagios.log
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.
fgilain
Posts: 8
Joined: Tue Nov 22, 2011 5:01 am

Re: Get list of actual alerts from command line ?

Post by fgilain »

problem is that this log file seems to contain too many alerts...not only actual ones, isn't it ?

Florent
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Get list of actual alerts from command line ?

Post by abrist »

Well, these will include soft and hard alerts for warnings. If you just want the criticals:

Code: Select all

grep CRITICAL /usr/local/nagios/var/nagios.log
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.
Locked