Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
OpenBSD 5 nrpe restart script
Simple script, download it or copy paste below into your own .sh file.
#!/bin/ksh
# Author: Kirk Hammond (kirk@elitetechservices.com)
# Version 0.5
#Get present npre process ID
PID=`ps -aux |grep nrpe |grep -v root | awk '{print $2}'`
#If process ID was found, kill it
if [ $PID ]
then
kill $PID
echo "Killed nrpe process with PID $PID"
fi
#Restart nrpe service
/usr/local/sbin/nrpe -c /etc/nrpe.cfg -d
#Wait for process to start, otherwise PID is null
sleep 3
#Get new process ID and echo it to shell
NEW=`ps -aux | grep nrpe | grep -v root | awk '{print $2}'`
echo "Restarted nrpe with PID $NEW"#
Reviews (0)
Be the first to review this listing!