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

check_temp_wget

Rating
0 votes
Favoured:
0
Current Version
1.0
Last Release Date
2017-03-05
Compatible With
  • Nagios 1.x
  • Nagios 2.x
  • Nagios 3.x
  • Nagios 4.x
Twitter Handle
K_double_A
Hits
3025

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

Basically, I couldn't find any plugins that would take characters (numbers) from a web page and then translate that into a plugin that would work within nagios. I decided to create this simple bash script to get the information (simple wget command) from the IP address to Nagios. Feel free to use and change however you would like.
#!/bin/bash

WARNING_LEVEL_TEMP=80
CRITICAL_LEVEL_TEMP=85

STATE_OK=0
STATE_WARNING=1
STATE_CRITICAL=2
STATE_UNKNOWN=3
STATE_DEPENDENT=4

# assumed usage:
# ./check_temp.sh http://somewhere.com
URL=$1
temp=$(wget $URL -q -O -)

echo "Temperature: $temp"

# Example:
# if [ $content -gt 80 ] && [ $content -lt 60 ]
# then
# echo "less then 80"
# fi


if [ $temp -ge $CRITICAL_LEVEL_TEMP ]
then
exit $STATE_CRITICAL;
elif [ $temp -ge $WARNING_LEVEL_TEMP ]
then
exit $STATE_WARNING;
else
exit $STATE_OK;
fi