Page 2 of 2

Re: alerts only run once, scheduler seems not to work

Posted: Wed Nov 16, 2016 10:16 am
by rkennedy
The nagios part just tells it to run as the nagios user. A couple things, what happens if you run su nagios and execute the jobs / poller? What is the output of ls -al /home/nagios?

Re: alerts only run once, scheduler seems not to work

Posted: Wed Nov 16, 2016 10:04 pm
by lrhazi
/home/nagios does not exist! but the command seems to run ok:

Code: Select all

[root@logdev01 ~]#
[root@logdev01 ~]# su - nagios
su: warning: cannot change directory to /home/nagios: No such file or directory
-bash-4.2$ id nagios
uid=1003(nagios) gid=100(users) groups=100(users),48(apache),1003(nagios)
-bash-4.2$  /usr/bin/php  /var/www/html/nagioslogserver/www/index.php poller
Updating Cluster Hosts File
Updating Elasticsearch with instance...
Updating Cluster Hosts File
Updating Elasticsearch with instance...
Updating Cluster Hosts File
Updating Elasticsearch with instance...
Updating Cluster Hosts File
Updating Elasticsearch with instance...
Finished Polling.
-bash-4.2$


Re: alerts only run once, scheduler seems not to work

Posted: Wed Nov 16, 2016 10:06 pm
by lrhazi

Code: Select all

-bash-4.2$ /usr/bin/php  /var/www/html/nagioslogserver/www/index.php jobs
Running command do_backups with args ' ' for job id: backups
SUCCESS
Running command run_alerts with args ' ' for job id: run_all_alerts
SUCCESS
Running command update_check with args ' ' for job id: run_update_check
SUCCESS
Running command cleanup with args ' ' for job id: cleanup_cmdsubsys
SUCCESS
Running command create_backup with args ' ' for job id: AVhwPr8GDX5HuAnvUwof
sh: /tmp/backups.log: Permission denied
SUCCESS
Running command run_alerts with args ' ' for job id: run_all_alerts
SUCCESS
Running command run_alerts with args ' ' for job id: run_all_alerts
SUCCESS
Processed 1 node jobs.
Processed 6 global jobs.
-bash-4.2$

Re: alerts only run once, scheduler seems not to work

Posted: Thu Nov 17, 2016 8:13 am
by lrhazi
Thanks a lot. It seems the missing hoemedir is the issue indeed.

Code: Select all

[root@logdev01 log]# tail -100 /var/log/cron|head
Nov 17 07:48:01 logdev01 CROND[8982]: (CRON) ERROR chdir failed (/home/nagios): No such file or directory
Nov 17 07:49:01 logdev01 CROND[9036]: (nagios) CMD (/usr/bin/php -q /var/www/html/nagioslogserver/www/index.php poller > /usr/local/nagioslogserver/var/poller.log 2>&1)
Nov 17 07:49:01 logdev01 CROND[9036]: (CRON) ERROR chdir failed (/home/nagios): No such file or directory
Nov 17 07:49:01 logdev01 CROND[9037]: (nagios) CMD (/usr/bin/php -q /var/www/html/nagioslogserver/www/index.php jobs > /usr/local/nagioslogserver/var/jobs.log 2>&1)
Nov 17 07:49:01 logdev01 CROND[9037]: (CRON) ERROR chdir failed (/home/nagios): No such file or directory
Create diot and alerts seem to run fine now!

Re: alerts only run once, scheduler seems not to work

Posted: Thu Nov 17, 2016 10:51 am
by mcapra
Awesome! Is it alright if we close this thread and mark the issue as resolved?

Re: alerts only run once, scheduler seems not to work

Posted: Thu Nov 17, 2016 10:54 am
by lrhazi
Yup. Appreciate the help.

Re: alerts only run once, scheduler seems not to work

Posted: Thu Nov 17, 2016 11:06 am
by rkennedy
Will do - I saw something similar happen last week, glad that was it.

/closed