Page 7 of 9

Re: nagios service issue

Posted: Mon May 15, 2017 5:01 pm
by nschetu
Still not created nagios lock file after restarting the daemons. Please find the output for below command.

[root@bhusprv024 etc]# service nagios stop
Stopping nagios (via systemctl): [ OK ]
[root@bhusprv024 etc]# killall -9 nagios
nagios: no process found
[root@bhusprv024 etc]# service httpd restart
Redirecting to /bin/systemctl restart httpd.service
[root@bhusprv024 etc]# service nagios start
Starting nagios (via systemctl): [ OK ]
[root@bhusprv024 etc]#


[root@bhusprv024 etc]# ps -ef --cols=300

Code: Select all

UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 May09 ?        00:04:01 /usr/lib/systemd/systemd --switched-root --system --deserialize 21
root         2     0  0 May09 ?        00:00:00 [kthreadd]
root         3     2  0 May09 ?        00:00:01 [ksoftirqd/0]
root         5     2  0 May09 ?        00:00:00 [kworker/0:0H]
root         7     2  0 May09 ?        00:00:06 [migration/0]
root         8     2  0 May09 ?        00:00:00 [rcu_bh]
root         9     2  0 May09 ?        00:02:01 [rcu_sched]
root        10     2  0 May09 ?        00:00:02 [watchdog/0]
root        11     2  0 May09 ?        00:00:01 [watchdog/1]
root        12     2  0 May09 ?        00:00:06 [migration/1]
root        13     2  0 May09 ?        00:00:01 [ksoftirqd/1]
root        15     2  0 May09 ?        00:00:00 [kworker/1:0H]
root        16     2  0 May09 ?        00:00:01 [watchdog/2]
root        17     2  0 May09 ?        00:00:06 [migration/2]
root        18     2  0 May09 ?        00:00:01 [ksoftirqd/2]
root        20     2  0 May09 ?        00:00:00 [kworker/2:0H]
root        21     2  0 May09 ?        00:00:01 [watchdog/3]
root        22     2  0 May09 ?        00:00:06 [migration/3]
root        23     2  0 May09 ?        00:00:01 [ksoftirqd/3]
root        25     2  0 May09 ?        00:00:00 [kworker/3:0H]
root        27     2  0 May09 ?        00:00:00 [kdevtmpfs]
root        28     2  0 May09 ?        00:00:00 [netns]
root        29     2  0 May09 ?        00:00:00 [khungtaskd]
root        30     2  0 May09 ?        00:00:00 [writeback]
root        31     2  0 May09 ?        00:00:00 [kintegrityd]
root        32     2  0 May09 ?        00:00:00 [bioset]
root        33     2  0 May09 ?        00:00:00 [kblockd]
root        34     2  0 May09 ?        00:00:00 [md]
root        43     2  0 May09 ?        00:00:00 [kswapd0]
root        44     2  0 May09 ?        00:00:00 [ksmd]
root        45     2  0 May09 ?        00:00:43 [khugepaged]
root        46     2  0 May09 ?        00:00:00 [fsnotify_mark]
root        47     2  0 May09 ?        00:00:00 [crypto]
root        55     2  0 May09 ?        00:00:00 [kthrotld]
root        57     2  0 May09 ?        00:00:00 [kmpath_rdacd]
root        58     2  0 May09 ?        00:00:00 [kpsmoused]
root        60     2  0 May09 ?        00:00:00 [ipv6_addrconf]
root        79     2  0 May09 ?        00:00:00 [deferwq]
root       111     2  0 May09 ?        00:00:05 [kauditd]
root       290     2  0 May09 ?        00:00:00 [mpt_poll_0]
root       291     2  0 May09 ?        00:00:00 [mpt/0]
root       292     2  0 May09 ?        00:00:00 [ata_sff]
root       293     2  0 May09 ?        00:00:00 [scsi_eh_0]
root       294     2  0 May09 ?        00:00:00 [scsi_tmf_0]
root       295     2  0 May09 ?        00:00:00 [scsi_eh_1]
root       296     2  0 May09 ?        00:00:00 [scsi_tmf_1]
root       299     2  0 May09 ?        00:00:00 [ttm_swap]
root       312     2  0 May09 ?        00:00:00 [scsi_eh_2]
root       313     2  0 May09 ?        00:00:00 [scsi_tmf_2]
root       394     2  0 May09 ?        00:00:00 [kworker/2:1H]
root       435     2  0 May09 ?        00:00:00 [kdmflush]
root       436     2  0 May09 ?        00:00:00 [bioset]
root       443     2  0 May09 ?        00:00:00 [kdmflush]
root       444     2  0 May09 ?        00:00:00 [bioset]
root       463     2  0 May09 ?        00:00:34 [jbd2/dm-1-8]
root       464     2  0 May09 ?        00:00:00 [ext4-rsv-conver]
root       540     1  0 May09 ?        00:01:35 /usr/lib/systemd/systemd-journald
root       564     1  0 May09 ?        00:00:00 /usr/sbin/lvmetad -f
root       574     2  0 May09 ?        00:00:00 [rpciod]
root       576     1  0 May09 ?        00:00:00 /usr/lib/systemd/systemd-udevd
root       617     2  0 17:40 ?        00:00:00 [kworker/3:1]
root       635     2  0 May09 ?        00:00:00 [kworker/0:1H]
root       643     2  0 May09 ?        00:00:00 [jbd2/sda1-8]
root       644     2  0 May09 ?        00:00:00 [ext4-rsv-conver]
root       646     2  0 May09 ?        00:00:00 [kdmflush]
root       647     2  0 May09 ?        00:00:00 [bioset]
root       654     2  0 May09 ?        00:00:00 [jbd2/dm-2-8]
root       655     2  0 May09 ?        00:00:00 [ext4-rsv-conver]
root       669     1  0 May09 ?        00:00:22 /sbin/auditd -n
polkitd    693     1  0 May09 ?        00:01:42 /usr/lib/polkit-1/polkitd --no-debug
dbus       695     1  0 May09 ?        00:05:01 /bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
root       703     1  0 May09 ?        00:00:00 /usr/sbin/gssproxy -D
root       710     1  0 May09 ?        00:02:24 /usr/lib/systemd/systemd-logind
root       711     1  0 May09 ?        00:00:20 /usr/sbin/irqbalance --foreground
root       729     1  0 May09 ?        00:01:12 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid
root       732     1  0 May09 ?        00:00:56 /usr/sbin/NetworkManager --no-daemon
root       788     2  0 17:41 ?        00:00:00 [kworker/1:0]
root       815     2  0 17:41 ?        00:00:00 [kworker/u8:1]
root       856     2  0 May09 ?        00:00:01 [kworker/3:1H]
root      1002     1  0 May09 ?        00:00:40 /usr/sbin/rsyslogd -n
root      1014     1  0 May09 ?        00:01:05 /usr/bin/python -Es /usr/sbin/tuned -l -P
root      1015     1  0 May09 ?        00:00:00 /usr/bin/rhsmcertd
root      1039     1  0 May09 ?        00:00:20 /usr/sbin/automount --pid-file /run/autofs.pid
root      1056     1  0 May09 ?        00:00:17 /usr/gsa/sbin/gsanslcd
root      1168     1  0 May09 ?        00:00:00 rhnsd
ajaxterm  1357     1  0 May09 ?        00:03:02 python /usr/share/ajaxterm/ajaxterm.py --daemon --port=8022 --uid=ajaxterm
nagios    1374     1  0 May12 ?        00:00:00 /usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg -f
nagios    1428     1  0 May12 ?        00:00:20 /usr/local/nagios/bin/npcd -d -f /usr/local/nagios/etc/pnp/npcd.cfg
root      1431     1  2 May09 ?        03:00:20 /opt/BESClient/bin/BESClient
ntp       1453     1  0 May12 ?        00:00:00 /usr/sbin/ntpd -u ntp:ntp -g
root      1470     1  0 May12 ?        00:00:12 /usr/sbin/crond -n
root      2809     2  0 May09 ?        00:00:00 [kworker/1:1H]
root      2858     1  0 May09 tty1     00:00:00 /sbin/agetty --noclear tty1 linux
root      2897     2  0 17:46 ?        00:00:00 [kworker/2:2]
root      3121     1  0 May09 ?        01:06:35 /opt/IBM/ITM/lx8266/lz/bin/klzagent
root      4284     2  0 17:50 ?        00:00:00 [kworker/u8:2]
root      4517     2  0 17:50 ?        00:00:00 [kworker/3:0]
root      5408     1  0 May09 ?        00:00:19 /opt/IBM/ITM/lx8266/lz/bin/kcawd
root      5542     1  0 17:53 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache    5545  5542  0 17:53 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache    5546  5542  0 17:53 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache    5548  5542  0 17:53 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache    5549  5542  0 17:53 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache    5550  5542  0 17:53 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache    5569  5542  0 17:53 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
nagios    5628     1  0 17:53 ?        00:00:00 /usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg
nagios    5630  5628  0 17:53 ?        00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios    5631  5628  0 17:53 ?        00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios    5632  5628  0 17:53 ?        00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios    5633  5628  0 17:53 ?        00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios    5634  5628  0 17:53 ?        00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios    5635  5628  0 17:53 ?        00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios    5636  1374  0 17:53 ?        00:00:00 /usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg -f
nagios    5637  5636  0 17:53 ?        00:00:00 /usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg -f
nagios    5642  5628  0 17:53 ?        00:00:00 /usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg
root      5649  1470  0 17:54 ?        00:00:00 /usr/sbin/CROND -n
root      5650  1470  0 17:54 ?        00:00:00 /usr/sbin/CROND -n
root      5651  1470  0 17:54 ?        00:00:00 /usr/sbin/CROND -n
root      5652  1470  0 17:54 ?        00:00:00 /usr/sbin/CROND -n
root      5653  1470  0 17:54 ?        00:00:00 /usr/sbin/CROND -n
root      5654  1470  0 17:54 ?        00:00:00 /usr/sbin/CROND -n
root      5659     1  0 May11 ?        00:00:00 /opt/tivoli/tsm/client/ba/bin/dsmcad
nagios    5663  5649  0 17:54 ?        00:00:00 /bin/sh -c /usr/bin/php -q /usr/local/nagiosxi/cron/perfdataproc.php >> /usr/local/nagiosxi/var/perfdataproc.log 2>&1
nagios    5667  5663  0 17:54 ?        00:00:00 /usr/bin/php -q /usr/local/nagiosxi/cron/perfdataproc.php
nagios    5669  5650  0 17:54 ?        00:00:00 /bin/sh -c /usr/bin/php -q /usr/local/nagiosxi/cron/feedproc.php >> /usr/local/nagiosxi/var/feedproc.log 2>&1
nagios    5670  5653  0 17:54 ?        00:00:00 /bin/sh -c /usr/bin/php -q /usr/local/nagiosxi/cron/cmdsubsys.php >> /usr/local/nagiosxi/var/cmdsubsys.log 2>&1
nagios    5671  5652  0 17:54 ?        00:00:00 /bin/sh -c /usr/bin/php -q /usr/local/nagiosxi/cron/eventman.php >> /usr/local/nagiosxi/var/eventman.log 2>&1
nagios    5672  5651  0 17:54 ?        00:00:00 /bin/sh -c /usr/bin/php -q /usr/local/nagiosxi/cron/event_handler.php >> /usr/local/nagiosxi/var/event_handler.log 2>&1
nagios    5673  5671  1 17:54 ?        00:00:00 /usr/bin/php -q /usr/local/nagiosxi/cron/eventman.php
nagios    5674  5669  0 17:54 ?        00:00:00 /usr/bin/php -q /usr/local/nagiosxi/cron/feedproc.php
nagios    5675  5654  0 17:54 ?        00:00:00 /bin/sh -c /usr/bin/php -q /usr/local/nagiosxi/cron/sysstat.php >> /usr/local/nagiosxi/var/sysstat.log 2>&1
nagios    5677  5670  0 17:54 ?        00:00:00 /usr/bin/php -q /usr/local/nagiosxi/cron/cmdsubsys.php
nagios    5678  5675  0 17:54 ?        00:00:00 /usr/bin/php -q /usr/local/nagiosxi/cron/sysstat.php
nagios    5680  5672  0 17:54 ?        00:00:00 /usr/bin/php -q /usr/local/nagiosxi/cron/event_handler.php
root      5821 13576  0 17:54 pts/0    00:00:00 ps -ef --cols=300
root     11859     1  0 May10 ?        00:00:00 /usr/sbin/sshd -D
root     13425 11859  0 12:32 ?        00:00:00 sshd: chetan.n [priv]
chetan.n 13495 13425  0 12:32 ?        00:00:00 sshd: chetan.n@pts/0
chetan.n 13496 13495  0 12:32 pts/0    00:00:00 -bash
root     13574 13496  0 12:32 pts/0    00:00:00 sudo su -
root     13575 13574  0 12:32 pts/0    00:00:00 su -
root     13576 13575  0 12:32 pts/0    00:00:00 -bash
root     18569     1  0 May10 ?        00:00:00 /opt/tivoli/tsm/client/ba/bin/dsmcad
root     18974     1  0 May11 ?        00:00:44 dsmc sched
root     21649     2  0 17:10 ?        00:00:00 [kworker/3:2]
mysql    26675     1  0 May12 ?        00:00:00 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
root     26681     2  0 17:23 ?        00:00:00 [kworker/u8:0]
mysql    27336 26675  0 May12 ?        00:13:12 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mariadb/mariadb.log --pid-file=/var/run/mariadb/mariadb.pid --socket=/var/lib/mysql/mysql.sock
root     27999     1  0 May12 ?        00:00:00 /usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid
root     28843     2  0 17:29 ?        00:00:00 [kworker/0:1]
root     29129     2  0 17:30 ?        00:00:00 [kworker/2:1]
root     29853     2  0 17:32 ?        00:00:00 [kworker/1:3]
root     31828     2  0 17:37 ?        00:00:00 [kworker/0:2]
[root@bhusprv024 etc]#

Re: nagios service issue

Posted: Mon May 15, 2017 11:40 pm
by nschetu
[root@bhusprv024 nagiosxi]# sestatus
SELinux status: disabled
[root@bhusprv024 nagiosxi]#

Re: nagios service issue

Posted: Tue May 16, 2017 9:20 am
by nschetu
Any solution for above issue.. ?

Re: nagios service issue

Posted: Tue May 16, 2017 9:30 am
by tgriep
In the /etc/sudoers files under this line

Code: Select all

#includedir /etc/sudoers.d
Add these lines

Code: Select all

Defaults:nagios !requiretty
Defaults:apache !requiretty
That will remove the requirement to need a tty for those users.

Then run the following commands and post the output.

Code: Select all

ls -l /usr/local/nagiosxi
ls -l /usr/local/nagiosxi/var
ls -l /usr/local/nagiosxi/var/subsys

su nagios
touch /usr/local/nagios/var/nagios.lock
chown nagios.nagios /usr/local/nagios/var/nagios.lock
Thanks

Re: nagios service issue

Posted: Tue May 16, 2017 10:20 am
by nschetu
Please find details below.

Code: Select all

[root@bhusprv024 etc]# ls -l /usr/local/nagiosxi
total 32
drwxr-xr-x  2 nagios nagios 4096 May 16 00:15 cron
drwxr-xr-x  3 nagios nagios 4096 May 16 00:15 etc
drwxr-xr-x 19 nagios nagios 4096 May 16 00:15 html
drwxr-xr-x  3 nagios nagios 4096 May 16 00:15 nom
drwxr-xr-x  2 nagios nagios 4096 May 16 10:58 scripts
drwsrwsr-x  2 apache nagios 4096 May 16 00:17 tmp
drwxr-xr-x  2 nagios nagios 4096 May 16 00:15 tools
drwxr-xr-x  5 nagios nagios 4096 May 16 11:08 var
[root@bhusprv024 etc]#
[root@bhusprv024 etc]#

Code: Select all

[root@bhusprv024 etc]# ls -l /usr/local/nagiosxi/var
total 6528
-rw-r--r-- 1 nagios apache  265368 May 16 11:09 cleaner.log
-rw-r--r-- 1 nagios apache  131508 May 16 11:09 cmdsubsys.log
drwsrwsr-x 2 apache nagios    4096 May 16 00:15 components
-rw-r--r-- 1 nagios apache       6 May 16 11:09 corelog.data
-rw-r--r-- 1 nagios apache       0 May 16 11:09 corelog.diff
-rw-r--r-- 1 nagios apache  427130 May 16 11:05 dbmaint.log
-rw-r--r-- 1 nagios apache       0 May 16 11:09 event_handler.lock
-rw-r--r-- 1 nagios apache  208970 May 16 11:09 event_handler.log
-rw-r--r-- 1 nagios apache  135761 May 16 11:09 eventman.log
-rw-r--r-- 1 nagios apache   18814 May 16 11:09 feedproc.log
-rw-r--r-- 1 nagios apache    1026 May 16 00:27 load_url.log
-rw-r--r-- 1 nagios apache    1323 May 16 00:20 nom.log
-rw-r--r-- 1 nagios apache   53263 May 16 11:09 perfdataproc.log
-rw-r--r-- 1 nagios apache    3003 May 16 11:01 recurringdowntime.log
-rw-r--r-- 1 nagios apache       0 May 16 00:19 reportengine.log
drwxr-xr-x 2 nagios nagios    4096 May 16 00:19 subsys
-rw-r--r-- 1 nagios apache 5344737 May 16 11:09 sysstat.log
drwxr-xr-x 2 nagios nagios    4096 May 16 00:15 upgrades
-rw-r--r-- 1 nagios nagios       7 May 16 00:18 xi-itype
-rw-r--r-- 1 nagios nagios     951 May 16 00:15 xi-sys.cfg
-rw-r--r-- 1 nagios nagios      37 May 16 00:18 xi-uuid
-rw-r--r-- 1 nagios nagios     196 May 16 00:15 xiversion
[root@bhusprv024 etc]#

Code: Select all

[root@bhusprv024 etc]# ls -l /usr/local/nagiosxi/var/subsys
total 4
-rw-r--r-- 1 root users 5 May 16 00:19 npcd.pid
[root@bhusprv024 etc]#

Code: Select all

[nagios@bhusprv024 ~]$ id
uid=1024(nagios) gid=48(apache) groups=48(apache),1024(nagios),1025(nagcmd)
[nagios@bhusprv024 ~]$ touch /usr/local/nagios/var/nagios.lock
[nagios@bhusprv024 ~]$ chown nagios.nagios /usr/local/nagios/var/nagios.lock

Re: nagios service issue

Posted: Tue May 16, 2017 10:28 am
by nschetu
Still not running nagios service.

Re: nagios service issue

Posted: Tue May 16, 2017 12:26 pm
by nschetu
Any update? We need to fix this ASAP. Please check and suggest us.

Re: nagios service issue

Posted: Tue May 16, 2017 12:46 pm
by tgriep
Something doesn't look right for some of the user / groups settings so can you run the following as root and post the output?

Code: Select all

chage -l nagios
chage -l apache
grep nagios /etc/passwd
grep apache /etc/passwd
grep nag /etc/group
grep apache /etc/group

Re: nagios service issue

Posted: Tue May 16, 2017 2:15 pm
by nschetu
Please find the user / groups settings output.

Code: Select all

[root@bhusprv024 ~]# chage -l nagios
Last password change                                    : May 16, 2017
Password expires                                        : never
Password inactive                                       : never
Account expires                                         : never
Minimum number of days between password change          : 0
Maximum number of days between password change          : 99999
Number of days of warning before password expires       : 7

Code: Select all

[root@bhusprv024 ~]# chage -l apache
Last password change                                    : May 04, 2017
Password expires                                        : never
Password inactive                                       : never
Account expires                                         : never
Minimum number of days between password change          : -1
Maximum number of days between password change          : -1
Number of days of warning before password expires       : -1
[root@bhusprv024 ~]#

Code: Select all

[root@bhusprv024 ~]# grep nagios /etc/passwd
nagios:x:1024:48::/home/nagios:/bin/bash
[root@bhusprv024 ~]#

Code: Select all

[root@bhusprv024 ~]# grep nag /etc/passwd
systemd-network:x:192:192:systemd Network Management:/:/sbin/nologin
nagios:x:1024:48::/home/nagios:/bin/bash
[root@bhusprv024 ~]#

Code: Select all

[root@bhusprv024 ~]# grep apache /etc/group
apache:x:48:
nagios:x:1024:nagios,apache
nagcmd:x:1025:nagios,apache
[root@bhusprv024 ~]#

Code: Select all

[root@bhusprv024 ~]# grep apache /etc/passwd
apache:x:48:48:Apache:/usr/share/httpd:/sbin/nologin
[root@bhusprv024 ~]#

Re: nagios service issue

Posted: Tue May 16, 2017 4:34 pm
by tgriep
Some if the files on the server have an incorrect user/group set on them, login as root to the server, run the following to fix that.

Code: Select all

service nagios stop
service ndo2db stop
service npcd stop
service crond stop
chown -R nagios.nagios /usr/local/nagiosxi/var/*
service crond start
service npcd start
nervice ndo2db start
service nagios start
Can you post this file from the server so we can view it?

Code: Select all

/etc/systemd/system/nagios.service
There may be a configuration error in that file.