alerts only run once, scheduler seems not to work

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

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

Post 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?
Former Nagios Employee
lrhazi
Posts: 9
Joined: Tue Nov 08, 2016 9:58 am

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

Post 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$

lrhazi
Posts: 9
Joined: Tue Nov 08, 2016 9:58 am

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

Post 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$
lrhazi
Posts: 9
Joined: Tue Nov 08, 2016 9:58 am

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

Post 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!
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

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

Post by mcapra »

Awesome! Is it alright if we close this thread and mark the issue as resolved?
Former Nagios employee
https://www.mcapra.com/
lrhazi
Posts: 9
Joined: Tue Nov 08, 2016 9:58 am

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

Post by lrhazi »

Yup. Appreciate the help.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

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

Post by rkennedy »

Will do - I saw something similar happen last week, glad that was it.

/closed
Former Nagios Employee
Locked