Page 1 of 2

Alert setup - not automatically run/fire

Posted: Mon May 22, 2017 4:05 pm
by Phaisan
Hi,
I setup a few alerts. I can run them manually and it runs fine.
However, it has never been run automatically. They all are setup at different Check interval such as 1d interval, 1h interval.
Last Run always show the time I run it manually. I have never seen any of them fire up on its own per Check schedule.

Query for the alerts does produce results and it fires up email when run manually.

Product: Nagios Log Server • 1.4.4

Thank you

Re: Alert setup - not automatically run/fire

Posted: Mon May 22, 2017 4:39 pm
by avandemore
What is the output from:

Code: Select all

# curl -XGET 'http://localhost:9200/nagioslogserver_log/_search/?size=20&pretty=1'

Re: Alert setup - not automatically run/fire

Posted: Thu Jun 01, 2017 12:22 pm
by Phaisan
Hi,
Here is the result
-----
{
"took" : 67,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 49834,
"max_score" : 1.0,
"hits" : [ {
"_index" : "nagioslogserver_log",
"_type" : "JOBS",
"_id" : "AVrZ1KZAtNgFi-n-vtsk",
"_score" : 1.0,
"_source":{"created":1489713276480,"created_by":"System","type":"JOBS","me ssage":"Finished Running run_alerts","node":"2df654c1-ea18-4f0c-ac88-ecd7b9b2e48 5","source":"Nagios Log Server"}
}, {
"_index" : "nagioslogserver_log",
"_type" : "JOBS",
"_id" : "AVrZ1Vf2tNgFi-n-vuHU",
"_score" : 1.0,
"_source":{"created":1489713321973,"created_by":"System","type":"JOBS","me ssage":"Finished Running run_alerts","node":"2df654c1-ea18-4f0c-ac88-ecd7b9b2e48 5","source":"Nagios Log Server"}
}, {
"_index" : "nagioslogserver_log",
"_type" : "JOBS",
"_id" : "AVrZ10DYtNgFi-n-vuH1",
"_score" : 1.0,
"_source":{"created":1489713447127,"created_by":"System","type":"JOBS","me ssage":"Finished Running run_alerts","node":"2df654c1-ea18-4f0c-ac88-ecd7b9b2e48 5","source":"Nagios Log Server"}
}, {
"_index" : "nagioslogserver_log",
"_type" : "JOBS",
"_id" : "AVrZ2yZHtNgFi-n-vuI1",
"_score" : 1.0,
"_source":{"created":1489713702470,"created_by":"System","type":"JOBS","me ssage":"Finished Running run_alerts","node":"2df654c1-ea18-4f0c-ac88-ecd7b9b2e48 5","source":"Nagios Log Server"}
}, {
"_index" : "nagioslogserver_log",
"_type" : "JOBS",
"_id" : "AVrZ3LwgtNgFi-n-vuJQ",
"_score" : 1.0,
"_source":{"created":1489713806367,"created_by":"System","type":"JOBS","me ssage":"Finished Running run_alerts","node":"2df654c1-ea18-4f0c-ac88-ecd7b9b2e48 5","source":"Nagios Log Server"}
}, {
"_index" : "nagioslogserver_log",
"_type" : "JOBS",
"_id" : "AVrZ4Y2gtNgFi-n-vuKm",
"_score" : 1.0,
"_source":{"created":1489714122144,"created_by":"System","type":"JOBS","me ssage":"Finished Running run_alerts","node":"2df654c1-ea18-4f0c-ac88-ecd7b9b2e48 5","source":"Nagios Log Server"}
}, {
"_index" : "nagioslogserver_log",
"_type" : "JOBS",
"_id" : "AVrZ43aotNgFi-n-vuLF",
"_score" : 1.0,
"_source":{"created":1489714247336,"created_by":"System","type":"JOBS","me ssage":"Finished Running run_alerts","node":"2df654c1-ea18-4f0c-ac88-ecd7b9b2e48 5","source":"Nagios Log Server"}
}, {
"_index" : "nagioslogserver_log",
"_type" : "JOBS",
"_id" : "AVrZ5HKFtNgFi-n-vuLW",
"_score" : 1.0,
"_source":{"created":1489714311812,"created_by":"System","type":"JOBS","me ssage":"Finished Running run_alerts","node":"2df654c1-ea18-4f0c-ac88-ecd7b9b2e48 5","source":"Nagios Log Server"}
}, {
"_index" : "nagioslogserver_log",
"_type" : "JOBS",
"_id" : "AVrZ5RAttNgFi-n-vuLg",
"_score" : 1.0,
"_source":{"created":1489714352172,"created_by":"System","type":"JOBS","me ssage":"Finished Running run_alerts","node":"2df654c1-ea18-4f0c-ac88-ecd7b9b2e48 5","source":"Nagios Log Server"}
}, {
"_index" : "nagioslogserver_log",
"_type" : "JOBS",
"_id" : "AVrZ6ox7tNgFi-n-vuM5",
"_score" : 1.0,
"_source":{"created":1489714711674,"created_by":"System","type":"JOBS","me ssage":"Finished Running run_alerts","node":"2df654c1-ea18-4f0c-ac88-ecd7b9b2e48 5","source":"Nagios Log Server"}
}, {
"_index" : "nagioslogserver_log",
"_type" : "JOBS",
"_id" : "AVrZ6-rntNgFi-n-vuNV",
"_score" : 1.0,
"_source":{"created":1489714801383,"created_by":"System","type":"JOBS","me ssage":"Finished Running run_alerts","node":"2df654c1-ea18-4f0c-ac88-ecd7b9b2e48 5","source":"Nagios Log Server"}
}, {
"_index" : "nagioslogserver_log",
"_type" : "JOBS",
"_id" : "AVrZ7SWwtNgFi-n-vuOD",
"_score" : 1.0,
"_source":{"created":1489714881967,"created_by":"System","type":"JOBS","me ssage":"Finished Running run_alerts","node":"2df654c1-ea18-4f0c-ac88-ecd7b9b2e48 5","source":"Nagios Log Server"}
}, {
"_index" : "nagioslogserver_log",
"_type" : "JOBS",
"_id" : "AVrZ7XQqtNgFi-n-vuOG",
"_score" : 1.0,
"_source":{"created":1489714902057,"created_by":"System","type":"JOBS","me ssage":"Finished Running run_alerts","node":"2df654c1-ea18-4f0c-ac88-ecd7b9b2e48 5","source":"Nagios Log Server"}
}, {
"_index" : "nagioslogserver_log",
"_type" : "JOBS",
"_id" : "AVrZ7_lRtNgFi-n-vuPC",
"_score" : 1.0,
"_source":{"created":1489715067216,"created_by":"System","type":"JOBS","me ssage":"Finished Running run_alerts","node":"2df654c1-ea18-4f0c-ac88-ecd7b9b2e48 5","source":"Nagios Log Server"}
}, {
"_index" : "nagioslogserver_log",
"_type" : "JOBS",
"_id" : "AVrZ8KZrtNgFi-n-vuPM",
"_score" : 1.0,
"_source":{"created":1489715111530,"created_by":"System","type":"JOBS","me ssage":"Finished Running run_alerts","node":"2df654c1-ea18-4f0c-ac88-ecd7b9b2e48 5","source":"Nagios Log Server"}
}, {
"_index" : "nagioslogserver_log",
"_type" : "JOBS",
"_id" : "AVrZ8PTctNgFi-n-vuPP",
"_score" : 1.0,
"_source":{"created":1489715131611,"created_by":"System","type":"JOBS","me ssage":"Finished Running run_alerts","node":"2df654c1-ea18-4f0c-ac88-ecd7b9b2e48 5","source":"Nagios Log Server"}
}, {
"_index" : "nagioslogserver_log",
"_type" : "JOBS",
"_id" : "AVrZ8ZJ0tNgFi-n-vuPZ",
"_score" : 1.0,
"_source":{"created":1489715171955,"created_by":"System","type":"JOBS","me ssage":"Finished Running run_alerts","node":"2df654c1-ea18-4f0c-ac88-ecd7b9b2e48 5","source":"Nagios Log Server"}
}, {
"_index" : "nagioslogserver_log",
"_type" : "JOBS",
"_id" : "AVrZ9CtMtNgFi-n-vuP7",
"_score" : 1.0,
"_source":{"created":1489715342156,"created_by":"System","type":"JOBS","me ssage":"Finished Running run_alerts","node":"2df654c1-ea18-4f0c-ac88-ecd7b9b2e48 5","source":"Nagios Log Server"}
}, {
"_index" : "nagioslogserver_log",
"_type" : "JOBS",
"_id" : "AVrZ9cP3tNgFi-n-vuQa",
"_score" : 1.0,
"_source":{"created":1489715446774,"created_by":"System","type":"JOBS","me ssage":"Finished Running run_alerts","node":"2df654c1-ea18-4f0c-ac88-ecd7b9b2e48 5","source":"Nagios Log Server"}
}, {
"_index" : "nagioslogserver_log",
"_type" : "JOBS",
"_id" : "AVrZ-EkhtNgFi-n-vuRD",
"_score" : 1.0,
"_source":{"created":1489715611936,"created_by":"System","type":"JOBS","me ssage":"Finished Running run_alerts","node":"2df654c1-ea18-4f0c-ac88-ecd7b9b2e48 5","source":"Nagios Log Server"}
} ]
}
}
-----------
Thank you

Re: Alert setup - not automatically run/fire

Posted: Thu Jun 01, 2017 1:14 pm
by avandemore
Can you attach the file /var/log/cron?

What is the output of:

Code: Select all

# service crond status
# date
# grep "date.timezone" /etc/php.ini

Re: Alert setup - not automatically run/fire

Posted: Thu Jun 01, 2017 7:23 pm
by Phaisan
Hi,
Cron files attached

The output of the command is empty. But, if I look at the file manually, I can find
/datetime.configuration.php#ini.date.timezone
date.timezone = US/Eastern

[root@smar-nagios-ls01 ~]# # service crond status
[root@smar-nagios-ls01 ~]# # date
[root@smar-nagios-ls01 ~]# # grep "date.timezone" /etc/php.ini
[root@smar-nagios-ls01 ~]#

Re: Alert setup - not automatically run/fire

Posted: Fri Jun 02, 2017 9:23 am
by avandemore
The output is empty because you prepended a # to the actual command therefor nullifying it. Please try again without the leading #.

Also the file I'm looking is precisely called /var/log/cron, if you don't have that file that indicates an issue.

Re: Alert setup - not automatically run/fire

Posted: Fri Jun 02, 2017 1:02 pm
by Phaisan
Ah, you can tell how familiar I am with Linux. Really did not pay attention to that.
Here is the result

[root@smar-nagios-ls01 ~]# service crond status
crond (pid 1191) is running...
[root@smar-nagios-ls01 ~]# date
Fri Jun 2 10:54:11 PDT 2017
[root@smar-nagios-ls01 ~]# grep "date.timezone" /etc/php.ini
; http://www.php.net/manual/en/datetime.c ... e.timezone
date.timezone = US/Eastern

cron file is attached

Thank you

Re: Alert setup - not automatically run/fire

Posted: Fri Jun 02, 2017 1:16 pm
by avandemore
Please try the following:

Code: Select all

tail -F /usr/local/nagioslogserver/var/jobs.log
From NLS > Administration > Command Subsystem do a Reset All Jobs.
Wait a minute then refresh NLS > Administration > Command Subsystem
Once run_all_alerts comes back with SUCCESS, please ctrl-C out the tail command and share the full output from it.

Re: Alert setup - not automatically run/fire

Posted: Fri Jun 02, 2017 3:36 pm
by Phaisan
Here is the result
tail: /usr/local/nagioslogserver/var/jobs.log: file truncated
Running command update_check with args ' ' for job id: run_update_check
SUCCESS
Processed 0 node jobs.
Processed 1 global jobs.
tail: /usr/local/nagioslogserver/var/jobs.log: file truncated
Processed 0 node jobs.
Processed 0 global jobs.
tail: /usr/local/nagioslogserver/var/jobs.log: file truncated

Re: Alert setup - not automatically run/fire

Posted: Mon Jun 05, 2017 10:27 am
by avandemore
Please provide a screenshot of NLS > Administration > Command Subsystem