Page 1 of 1

Alerting Not Running

Posted: Tue Dec 23, 2014 10:38 am
by 34Bearman
I have two alerts setup in Nagios Log Server to run every 5 minutes (5m). However they don't appear to run by themselves as their last execution date shown is when I ran them manually. Crond is started on the backend. What should I look at from here?

Re: Alerting Not Running

Posted: Tue Dec 23, 2014 11:12 am
by lgroschen
Can you post a screenshot of the alerts page? Also did you check the "alert only when critical/warning threshold is met" check box in the alert creation modal?

Re: Alerting Not Running

Posted: Tue Dec 23, 2014 11:48 am
by 34Bearman
Yes, Only alert when Warning or Critical threshold is met was checked when I created the alerts. Thresholds were set at 1 for both warning and critical.

Alert Dashboard.jpg
Alert Dashboard.jpg

Re: Alerting Not Running

Posted: Tue Dec 23, 2014 12:36 pm
by lgroschen
Navigate to Administration > Audit Reports

In the table it should show the cron jobs that run on Nagios Log Server. Look for the Alert job- there should be a job run every 20 seconds so it will be very visible. If there aren't any alert jobs in the table at all you might have an issue with the jobs not running correctly.

Re: Alerting Not Running

Posted: Tue Dec 23, 2014 1:02 pm
by 34Bearman
The job does not exist in the Audit report. How do I go about recreating that job or rescheduling it to run?

Thanks for your help.

Re: Alerting Not Running

Posted: Tue Dec 23, 2014 2:51 pm
by scottwilkerson
Could you run the following from the CLI on your log server and post the output to verify it is missing

Code: Select all

curl -XGET 'http://localhost:9200/nagioslogserver/commands/_search?pretty&q=command:run_alerts' 

Thanks!

Re: Alerting Not Running

Posted: Tue Dec 23, 2014 2:55 pm
by scottwilkerson
If the hits comes back as

Code: Select all

"hits" : {
    "total" : 0,
    "max_score" : null,
    "hits" : [ ]
  }
Run the following

Code: Select all

curl -XPUT 'http://localhost:9200/nagioslogserver/commands/run_all_alerts' -d '{"command":"run_alerts","run_time":1,"frequency":20,"node":"global","type":"system","status":"waiting","active":1}'

Re: Alerting Not Running

Posted: Tue Dec 23, 2014 4:12 pm
by 34Bearman
Here's what I received:

[root@localhost ~]# curl -XGET 'http://localhost:9200/nagioslogserver/c ... run_alerts'
{
"took" : 8,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 1,
"max_score" : 4.020425,
"hits" : [ {
"_index" : "nagioslogserver",
"_type" : "commands",
"_id" : "Y3G0RalSQgiYRVX1QkxiZA",
"_score" : 4.020425,
"_source":{"created":"2014-11-26 10:52:15","active":1,"status":"running","type":"system","node":"global","command":"run_alerts","run_time":1418854926,"frequency":"20","last_run_time":"2014-12-17 17:21:46","last_run_status":"SUCCESS"}
} ]
}
}

Re: Alerting Not Running

Posted: Wed Dec 24, 2014 10:04 am
by 34Bearman
I ran the command above and alerts are now functioning. Thanks for your help!

Re: Alerting Not Running

Posted: Fri Dec 26, 2014 10:29 am
by cmerchant
Great! We'll go ahead and close this thread. Thanks.