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

Directory Tree

Sam Weather 2.0

Rating
3 votes
Favoured:
3
Current Version
2.0
Last Release Date
2013-09-23
Compatible With
  • Nagios XI
License
GPL
Hits
68094
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
Sam Weather 2.0
Weather plugin for Nagios that lets you check temperature, humidity, wind, rain fall, dewpoint, heat index, windchill, pressure, solar radiation, and UV index. This also reports performance data to Nagios for graphing. The plugin uses data from Weather Underground. If you have any questions, issues, or suggestions please do not hesitate to email me (samueldockery@gmail.com).
Sam Weather Ver. 2.0
Author: Sam Dockery
Email: samueldockery@gmail.com

What's New with 2.0:
1. Warning & Critical levels
2. Added Pressure, Solar Radiation, & UV Index to parameters

To find your STATIONID, go to http://www.wunderground.com/wundermap/ and search for a station near your location.
Click on the station and you will see an alphanumeric Station ID.
Software requirements are LYNX, GREP, and CUT. These should be availble through your package manager (yum, apt-get, etc.)
Should work with Nagios, NagiosXI, and any Unix/Linux system as long as the software requirements are met.
Each weather parameter includes performance data (so long as the output isn't a string).

Troubleshooting Tips:
1. Make sure the plugin has the correct permissions on the file. chown nagios:nagios samweather or chown apache:apache samweather
2. Make sure you have the correct stationid, put it in all caps to be safe. Example: KALAUBUR4
3. Only use 1 weather parameter at a time. Might add the capability in the future for more parameters at a time.
4. If the plugin returns no data, either the weather underground site is unavailable or you have an incorrect stationid.
5. If you still have issues, verify you can open the stationid on the weather underground site. Replace your stationid with the one at the end of
Example: http://api.wunderground.com/weatherstation/WXCurrentObXML.asp?ID=KALAUBUR4
6. Verify you have LYNX, GREP, and CUT installed.

Usage:
./samweather stationid weatherparameter warn crit

Example:
./samweather KALAUBUR4 temp 80 90

Output:
Temperature: 79.5 F (26.4 C) | 'Temp F'=79.5 'Temp C'=26.4

Weather Parameters are:
temp - Temperature in F & C
heatindex - Heat Index in F & C
humidity - Relative Humidity
wind - Wind direction, degrees, and MPH
precip - Precipitation today in Inches & Cent.
press - Pressure in MB & In
dewpoint - Dewpoint in F & C
windchill - Windchill in F & C
solar - Solar Radiation in watts/m^2
uv - UV Index

Huge thanks to Daniele at www.kernel-panic.it for assiting in the development of this plugin. And a thanks to weyoon on the Nagios Exchange for the suggestion of adding Pressure stats to the plugin.
Reviews (3)
byqpoKycHuK, September 4, 2016
Can I get the conditions Weather (rain, clear)?

For example, use "getvalue condition"
dont help me.
byelpatron, October 15, 2013
1 of 1 people found this review helpful
Thanks for this creative plugin - runs fine on my RaspberryPi / Nagios4.
byweyoon, April 9, 2013
1 of 1 people found this review helpful
Add the following to the script to add pressure (press):

#Output for Pressure
if [ $2 = "press" ]
then
VAR1=$(lynx -dump -source http://api.wunderground.com/weatherstation/WXCurrentObXML.asp?ID=$1 | grep pressure_mb | cut -d">" -f2 | cut -d"" -f2 | cut -d"" -f2 | cut -d" printf "Pressure: $VAR3 | 'MB'=$VAR1 'IN'=$VAR2\n"
exit
fi
Owner's reply

Thanks! I'll be adding this in to version 2.