Home Directory Addons Monitoring Agents OpenBSD 5 nrpe restart script

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

OpenBSD 5 nrpe restart script

Rating
0 votes
Favoured:
0
Current Version
0.5
Last Release Date
2012-02-23
Compatible With
  • Nagios 3.x
Owner
License
GPL
Hits
71639
Files:
FileDescription
nrpe_restart.shnrpe_restart.sh

Help Support Ethan Galstad's New Project:

Help Support Ethan

A Message From The Founder...

As the founder of Nagios, I'm asking for your help in a cause that's dear to my heart.

I'm launching a new project to help better the world by providing the information, ideas, and inspiration that I believe can improve the lives of people everywhere.

I know you're busy managing networks, but I would appreciate it if you would consider liking my Facebook page and showing your support for the content and messages I produce by sharing them with your friends and family.

You can learn more about my project by visiting ethangalstad.me/nagios. Thank you for your time. I wish you all the best in your endeavors, whatever they may be.

- Ethan

I wrote a script to reload nrpe on OpenBSD. You can easily start nrpe at boot up, but I grew tired of manually killing then launching nrpe each time I updated the nrpe.cfg file

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"#