Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Sam Weather 2.0
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 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.
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)
Can I get the conditions Weather (rain, clear)?
For example, use "getvalue condition"
dont help me.
For example, use "getvalue condition"
dont help me.
Thanks for this creative plugin - runs fine on my RaspberryPi / Nagios4.
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
#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.