Host Server Services Restart from Nagios Server
-
epixelitsupport
- Posts: 85
- Joined: Fri Nov 08, 2019 2:40 am
Re: Host Server Services Restart from Nagios Server
after changing the value to dont_blame_nrpe=1 I'm getting the output is https://prnt.sc/qcp52t
-
scottwilkerson
- 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 show the results of running the following on the remote server
Also, can you tail the syslog on the remote server while attempting your original command from the Nagios server and seeing of you are getting an error?
Code: Select all
/usr/local/nagios/bin/nrpe-
epixelitsupport
- Posts: 85
- Joined: Fri Nov 08, 2019 2:40 am
Re: Host Server Services Restart from Nagios Server
Please find the output in clinet machine : https://prnt.sc/qcqh77
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Host Server Services Restart from Nagios Server
Ok, this is an Ubuntu machine and I would suspect the same as your other thread is is getting caught up on the special chars, change your command from this
to this
than then restart nrpe
Code: Select all
command[service_restart]=sudo service $ARG1$ restart 2>&1Code: Select all
command[service_restart]=sudo service $ARG1$ restart| tr -cd '\11\12\15\40-\176' 2>&1-
epixelitsupport
- Posts: 85
- Joined: Fri Nov 08, 2019 2:40 am
Re: Host Server Services Restart from Nagios Server
I did the same but still getting the same output
https://prnt.sc/qd25kl
Output from Nagios Server: https://prnt.sc/qd27bb
Client Machine nrpe status: https://prnt.sc/qd27w3
https://prnt.sc/qd25kl
Output from Nagios Server: https://prnt.sc/qd27bb
Client Machine nrpe status: https://prnt.sc/qd27w3
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Host Server Services Restart from Nagios Server
Did you restart nrpe on the remote server?epixelitsupport wrote:I did the same but still getting the same output
https://prnt.sc/qd25kl
Output from Nagios Server: https://prnt.sc/qd27bb
Client Machine nrpe status: https://prnt.sc/qd27w3
-
epixelitsupport
- Posts: 85
- Joined: Fri Nov 08, 2019 2:40 am
Re: Host Server Services Restart from Nagios Server
Yes restarted
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Host Server Services Restart from Nagios Server
This is a bit strange, but you might want to change the command to something like this
and then create the script /usr/local/nagios/libexec/restart_service.sh
Set the script to be executable
And then restart nrpe
Code: Select all
command[service_restart]=/usr/local/nagios/libexec/restart_service.sh $ARG1$Code: Select all
#!/bin/bash
status=$(sudo service $1 restart)
echo "service $1 restarted"Code: Select all
chmod +x /usr/local/nagios/libexec/restart_service.sh-
epixelitsupport
- Posts: 85
- Joined: Fri Nov 08, 2019 2:40 am
Re: Host Server Services Restart from Nagios Server
okay That one is worked ... SO can i proceed with the Event Handler Script, Do i need to proceed it in the same way or do i need to change anything in it ?
is it possible to handle those commands from my Nagios Core GUI Dashboard itself?
is it possible to handle those commands from my Nagios Core GUI Dashboard itself?
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Host Server Services Restart from Nagios Server
Yes, you would proceed in the same way.epixelitsupport wrote:can i proceed with the Event Handler Script, Do i need to proceed it in the same way or do i need to change anything in it ?
In Nagios Core, you would need to create the commands manually, there isn't a GUI config. Nagios XI has a GUI configepixelitsupport wrote:is it possible to handle those commands from my Nagios Core GUI Dashboard itself?
https://www.nagios.com/products/nagios-xi/