Nagios Exchange Nagios Exchange
  • Home
  • Directory
  • Library
  • Support
  • About
  • Submit Feedback

Advanced Search

Build precise queries to find exactly what you need

Search Logic

Select compatible versions

Press ESC to close

Sign In Sign Up

Nagios World Conference 2026: Sept. 14-17 in St. Paul, MN | Learn More

  • Home
  • Directory
  • Library
  • Support
  • About
  • Submit Feedback
Plugins4406Themes and Skins13Add-ons760Graphics and Logos36View All Categories
LinuxSecuritySNMPFile SystemCloud
New Listings Recently Updated Listings Most Favored Listings Most Popular Listings Most Rated Listings Most Reviewed Listings
Random Project
Java Applications and Servers check_hadoop_jobtrackers
0.0 (0)
83.6K
RSS Feed
Newest Listings Updated Listings
Top Contributors
deskwork_itunes142 (4)Chad Columbus (3)Marcin Bednarski (3)Davide Lemma (3)Gary T. GIesen (2)
See More
Newest Contributors
pawal (1)matthewducey (1)Linuxfabrik (1)signalgrid (1)Sanna Glue (2)
See More

Copyright © 2009-2026 Nagios Enterprises, LLC. All rights reserved.

Privacy PolicyTerms of UseTrademarks
Home > Angel L. Mateo
AL

Angel L. Mateo

@amateo

User Stats

Member Since: March 8, 2012

Favorites0

Views

Projects0

No Projects Found
check_iostat - I/O statistics

Update

I have created a patched version between original version and philippn's one. This patch: * Runs iostat just once. * Avoids the conversion between '.' and ',' by running iostat with LANG=C * Gets actual values not the ones from last reboot. * Runs from bash This is the patch: Index: check_iostat =================================================================== --- check_iostat (revisión: 11002) +++ check_iostat (copia de trabajo) @@ -1,9 +1,20 @@ -#!/bin/sh +#!/bin/bash # # Version 0.0.2 - Jan/2009 # Changes: added device verification +# +# by Thiago Varela - [email protected] # -# by Thiago Varela - [email protected] +# -------------------------------------- +# +# Version 0.0.3 - Dec/2011 +# Changes: +# - changed values from bytes to mbytes +# - fixed bug to get traffic data without comma but point +# - current values are displayed now, not average values (first run of iostat) +# +# by Philipp Niedziela - [email protected] +# iostat=`which iostat 2>/dev/null` bc=`which bc 2>/dev/null` @@ -50,14 +61,19 @@ echo "ERROR: critical levels must be highter than warning levels" && help +# iostat parameters: +# -m: megabytes +# -k: kilobytes +# first run of iostat shows statistics since last reboot, second one shows current vaules of hdd # Doing the actual check: -tps=`$iostat $disk | grep $disk | awk '{print $2}'` -kbread=`$iostat $disk | grep $disk | awk '{print $3}'` -kbwritten=`$iostat $disk | grep $disk | awk '{print $4}'` +# We get just 2nd line, which is the actual value +output=$(LANG=C $iostat $disk -d 1 2 | grep $disk | sed -n '2p') +tps=$(echo "$output" | awk '{print $2}') +kbread=$(echo "$output" | awk '{print $3}') +kbwritten=$(echo "$output" | awk '{print $4}') - # Comparing the result and setting the correct level: -if ( [ "`echo "$tps >= $crit_tps" | bc`" == "1" ] || [ "`echo "$kbread >= $crit_read" | bc`" == "1" ] || +if ( [ "`echo "$tps >= $crit_tps" | bc`" == "1" ] || [ "`echo "$kbread >= $crit_read" | bc -q`" == "1" ] || [ "`echo "$kbwritten >= $crit_written" | bc`" == "1" ] ); then msg="CRITICAL" status=2

Reviewed 13 years ago

No Favorites Found

Copyright © 2009-2026 Nagios Enterprises, LLC. All rights reserved.

Privacy PolicyTerms of UseTrademarks
Home Browse Submit Profile