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

Advanced Search

Build precise queries to find exactly what you need

Search Logic

Select compatible versions

Press ESC to close

Sign In Sign Up
  • Home
  • Directory
  • Library
  • Support
  • About
Plugins4390Themes and Skins11Add-ons736Documentation283Graphics 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
Nagios Log Server Documentation Nagios Log Server – Adding Additional Instances To Cluster
0.0 (0)
6.5K
RSS Feed
Newest Listings Updated Listings
Top Contributors
Julien DESMAREST (6)LAMY (6)Davide Lemma (4)deskwork_itunes142 (4)Joerg Hoerter (3)
See More
Newest Contributors
apham (1)mngvn (2)Georg2Korger2 (1)Guillaume8723 (1)Salvo (1)
See More

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

Privacy PolicyTerms of UseTrademarks
Home > Aleksei Kurepin
AK

Aleksei Kurepin

@niemi

User Stats

Member Since: November 6, 2014

Favorites0

Views

Projects0

No Projects Found
check_mem.sh

works nice

Nagios 3.0.6 making some changes, remove some spaces and ";" and it works on my nagios. Thanks to Athor! ======================================[code]======================= #!/bin/bash if [ "$1" = "-w" ] && [ "$2" -gt "0" ] && [ "$3" = "-c" ] && [ "$4" -gt "0" ]; then memTotal_b=`free -b |grep Mem |awk '{print $2}'` memFree_b=`free -b |grep Mem |awk '{print $4}'` memBuffer_b=`free -b |grep Mem |awk '{print $6}'` memCache_b=`free -b |grep Mem |awk '{print $7}'` memTotal_m=`free -m |grep Mem |awk '{print $2}'` memFree_m=`free -m |grep Mem |awk '{print $4}'` memBuffer_m=`free -m |grep Mem |awk '{print $6}'` memCache_m=`free -m |grep Mem |awk '{print $7}'` memUsed_b=$(($memTotal_b-$memFree_b-$memBuffer_b-$memCache_b)) memUsed_m=$(($memTotal_m-$memFree_m-$memBuffer_m-$memCache_m)) memUsedPrc=$((($memUsed_b*100)/$memTotal_b)) if [ "$memUsedPrc" -ge "$4" ]; then echo "Memory: CRITICAL Total: $memTotal_m MB - Used: $memUsed_m MB - $memUsedPrc% used!|Total=$memTotal_b;;;Used=$memUsed_b;;;Cache=$memCache_b;;;Buffer=$memBuffer_b;;;" $(exit 2) elif [ "$memUsedPrc" -ge "$2" ]; then echo "Memory: WARNING Total: $memTotal_m MB - Used: $memUsed_m MB - $memUsedPrc% used!|Total=$memTotal_b;;;Used=$memUsed_b;;;Cache=$memCache_b;;;Buffer=$memBuffer_b;;;" $(exit 1) else echo "Memory: OK Total: $memTotal_m MB - Used: $memUsed_m MB - $memUsedPrc% used|Total=$memTotal_b;;;Used=$memUsed_b;;;Cache=$memCache_b;;Buffer=$memBuffer_b;;;" $(exit 0) fi else echo "check_mem v1.1" echo "" echo "Usage:" echo "check_mem.sh -w -c " echo "" echo "warnlevel and critlevel is percentage value without %" echo "" echo "Copyright (C) 2012 Lukasz Gogolin ([email protected])" exit fi ======================================[code]=======================

Reviewed 11 years ago

No Favorites Found

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

Privacy PolicyTerms of UseTrademarks
Home Browse Submit Profile