Restarting Linux Service With NRPE Problem
Posted: Tue Jun 14, 2016 8:33 am
Hi, guys...
First, my environment:
Nagios Server CentOS 6.7
Remote Host: CentOS Linux 7.2.1511
Something special in the environment? Nothing... same plugins...
My problem is that i am following the "Restarting Linux Service With NRPE" Nagios guide... but when i try to restart any service, it doesn't work... dont restart...
By example... i'm trying to restart ntpd service like in the guide... when i exec the command it happens nothing... and when i exec locally the command, it shows the message and doesn't restart the ntpd command...
/usr/local/nagios/libexec/check_nrpe -H <Remote IP> -t 30 -c check_init_service -a 'ntpd'
● ntpd.service - Network Time Service
Loaded: loaded (/usr/lib/systemd/system/ntpd.service; disabled; vendor preset: disabled)
Active: inactive (dead) since Tue 2016-06-14 05:51:17 PDT; 17min ago
Process: 40312 ExecStart=/usr/sbin/ntpd -u ntp:ntp $OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 40313 (code=exited, status=0/SUCCESS)
Jun 14 05:38:49 portal ntpd[40313]: Listening on routing socket on fd #25 for interface updates
Jun 14 05:39:06 portal ntpd[40313]: 0.0.0.0 c016 06 restart
Jun 14 05:39:06 portal ntpd[40313]: 0.0.0.0 c012 02 freq_set kernel 11.091 PPM
Jun 14 05:39:08 portal ntpd[40313]: 0.0.0.0 c61c 0c clock_step -2.835776 s
Jun 14 05:39:05 portal ntpd[40313]: 0.0.0.0 c614 04 freq_mode
Jun 14 05:39:06 portal ntpd[40313]: 0.0.0.0 c618 08 no_sys_peer
Jun 14 05:40:17 portal ntpd[40313]: 0.0.0.0 c628 08 no_sys_peer
Jun 14 05:51:15 portal ntpd[40313]: ntpd exiting on signal 15
Jun 14 05:51:15 portal systemd[1]: Stopping Network Time Service...
Jun 14 05:51:17 portal systemd[1]: Stopped Ne
and is the same with the httpd command...
/usr/local/nagios/libexec/check_nrpe -H <Remote IP> -t 30 -c check_init_service -a 'httpd'
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
Active: active (running) since Tue 2016-06-14 05:40:24 PDT; 49min ago
Docs: man:httpd(8)
man:apachectl(8)
Main PID: 40384 (httpd)
Status: "Total requests: 0; Current requests/sec: 0; Current traffic: 0 B/sec"
CGroup: /system.slice/httpd.service
├─40384 /usr/sbin/httpd -DFOREGROUND
├─40431 /usr/sbin/httpd -DFOREGROUND
├─40432 /usr/sbin/httpd -DFOREGROUND
├─40433 /usr/sbin/httpd -DFOREGROUND
├─40434 /usr/sbin/httpd -DFOREGROUND
└─40435 /usr/sbin/httpd -DFOREGROUND
Jun 14 05:39:19 portal systemd[1]: Starting The Apache HTTP Server...
Jun 14 05:40:21 portal httpd[40384]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::20c
fe3e:dd42. Set the 'ServerName' directive globally to suppress this message
All the remote hosts services are being monitored... it works excellent!!! And i have a windows machine with NSClient and it restarts the services... but with linux, i can't do it work!!!
Thank you by your help!!!
First, my environment:
Nagios Server CentOS 6.7
Remote Host: CentOS Linux 7.2.1511
Something special in the environment? Nothing... same plugins...
My problem is that i am following the "Restarting Linux Service With NRPE" Nagios guide... but when i try to restart any service, it doesn't work... dont restart...
By example... i'm trying to restart ntpd service like in the guide... when i exec the command it happens nothing... and when i exec locally the command, it shows the message and doesn't restart the ntpd command...
/usr/local/nagios/libexec/check_nrpe -H <Remote IP> -t 30 -c check_init_service -a 'ntpd'
● ntpd.service - Network Time Service
Loaded: loaded (/usr/lib/systemd/system/ntpd.service; disabled; vendor preset: disabled)
Active: inactive (dead) since Tue 2016-06-14 05:51:17 PDT; 17min ago
Process: 40312 ExecStart=/usr/sbin/ntpd -u ntp:ntp $OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 40313 (code=exited, status=0/SUCCESS)
Jun 14 05:38:49 portal ntpd[40313]: Listening on routing socket on fd #25 for interface updates
Jun 14 05:39:06 portal ntpd[40313]: 0.0.0.0 c016 06 restart
Jun 14 05:39:06 portal ntpd[40313]: 0.0.0.0 c012 02 freq_set kernel 11.091 PPM
Jun 14 05:39:08 portal ntpd[40313]: 0.0.0.0 c61c 0c clock_step -2.835776 s
Jun 14 05:39:05 portal ntpd[40313]: 0.0.0.0 c614 04 freq_mode
Jun 14 05:39:06 portal ntpd[40313]: 0.0.0.0 c618 08 no_sys_peer
Jun 14 05:40:17 portal ntpd[40313]: 0.0.0.0 c628 08 no_sys_peer
Jun 14 05:51:15 portal ntpd[40313]: ntpd exiting on signal 15
Jun 14 05:51:15 portal systemd[1]: Stopping Network Time Service...
Jun 14 05:51:17 portal systemd[1]: Stopped Ne
and is the same with the httpd command...
/usr/local/nagios/libexec/check_nrpe -H <Remote IP> -t 30 -c check_init_service -a 'httpd'
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
Active: active (running) since Tue 2016-06-14 05:40:24 PDT; 49min ago
Docs: man:httpd(8)
man:apachectl(8)
Main PID: 40384 (httpd)
Status: "Total requests: 0; Current requests/sec: 0; Current traffic: 0 B/sec"
CGroup: /system.slice/httpd.service
├─40384 /usr/sbin/httpd -DFOREGROUND
├─40431 /usr/sbin/httpd -DFOREGROUND
├─40432 /usr/sbin/httpd -DFOREGROUND
├─40433 /usr/sbin/httpd -DFOREGROUND
├─40434 /usr/sbin/httpd -DFOREGROUND
└─40435 /usr/sbin/httpd -DFOREGROUND
Jun 14 05:39:19 portal systemd[1]: Starting The Apache HTTP Server...
Jun 14 05:40:21 portal httpd[40384]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::20c
All the remote hosts services are being monitored... it works excellent!!! And i have a windows machine with NSClient and it restarts the services... but with linux, i can't do it work!!!
Thank you by your help!!!