Host Server Services Restart from Nagios Server
-
- Posts: 85
- Joined: Fri Nov 08, 2019 2:40 am
Host Server Services Restart from Nagios Server
Is it possible to restart services which are running in Host servers from Nagios Server?
Please let me know the solution if the above one works
Please let me know the solution if the above one works
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Host Server Services Restart from Nagios Server
You can with event handlers if you have agents installed.
Here are a few guides on how to do that, the guides are written for Nagios XI but you can apply the same methods to Nagios Core
https://library.nagios.com/library/prod ... nagios-xi/
Here are a few guides on how to do that, the guides are written for Nagios XI but you can apply the same methods to Nagios Core
https://library.nagios.com/library/prod ... nagios-xi/
-
- Posts: 85
- Joined: Fri Nov 08, 2019 2:40 am
Re: Host Server Services Restart from Nagios Server
I'm Using Nagios Core for checking the services, When I trying to start configuring above service I'm getting an error like this https://prnt.sc/qbv9i0 while I'm accessing client machine from Nagios server
Please let me know the solution
Please let me know the solution
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Host Server Services Restart from Nagios Server
Are you sure the service name on the remote host is crond and not just cron or some other variation?
-
- Posts: 85
- Joined: Fri Nov 08, 2019 2:40 am
Re: Host Server Services Restart from Nagios Server
Yea I tried in client server there I'm getting the output when I'm trying with the command
Trying from Nagios Server to the Client Machine: https://prnt.sc/qce05z
In the Client machine: https://prnt.sc/qce0x6
Trying from Nagios Server to the Client Machine: https://prnt.sc/qce05z
In the Client machine: https://prnt.sc/qce0x6
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Host Server Services Restart from Nagios Server
Can you share the command specified for restart_service in the nrpe.cfg as well as the script you are running in that command
-
- Posts: 85
- Joined: Fri Nov 08, 2019 2:40 am
Re: Host Server Services Restart from Nagios Server
As you are mentioned in the Document, I'm following the same
This is what I m added in the nrpe.cfg file in the client machine: https://prnt.sc/qcmtbr
This is the script im running from the Nagios Server: /usr/local/nagios/libexec/check_nrpe -H XX.X.X.X -p 5666 -c service_restart -a cron
And i didn't create a Create Event Handler Script since I'm not getting a proper output from the above commands as mentioned in the Document
This is what I m added in the nrpe.cfg file in the client machine: https://prnt.sc/qcmtbr
This is the script im running from the Nagios Server: /usr/local/nagios/libexec/check_nrpe -H XX.X.X.X -p 5666 -c service_restart -a cron
And i didn't create a Create Event Handler Script since I'm not getting a proper output from the above commands as mentioned in the Document
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Host Server Services Restart from Nagios Server
Can you share your whole nrpe.cfg from the remote machine, we need to see if you have
Code: Select all
dont_blame_nrpe=1
-
- Posts: 85
- Joined: Fri Nov 08, 2019 2:40 am
Re: Host Server Services Restart from Nagios Server
Please find the attached one
here Dont blame value=0
here Dont blame value=0
- Attachments
-
- nrpe.cfg
- nrpe config file
- (12.33 KiB) Downloaded 165 times
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Host Server Services Restart from Nagios Server
Change the value to 1
Then restart nrpe
Then restart nrpe