FreeBSD memory check

Bookmark and Share

Rating
0 votes
Favoured:
0
Current Version
0.7
Last Release Date
2011-04-11
Compatible With
  • Nagios 3.x
Owner
Hits
60473
Files:
FileDescription
check_fbsd_mem.shcheck_fbsd_mem.sh
FreeBSD memory check
This plugin checks the FreeBSD memory usage.
You can set warning and critical memory usage integer/precentage(%) values with -w and -c. With -p you can output performance data and with 'swap' keyword generate alerts based on swap usage.


* Download the script.
* If the nagios-plugin package isn't already installed, install it.
* Copy the script to /usr/local/libexec/nagios/.
* Set the executable flag chmod +x /usr/local/libexec/nagios/check_fbsd_mem.sh


Example usage:
# /usr/local/libexec/nagios/check_fbsd_mem.sh -p -w 10% -c 15% swap
Will produce following output:
OK - Total: 2047M Used: 506M Active: 35M Inact: 156M Wired: 239M Cache: 0M Buf: 213M Swap: 4096M SwUsed: 0M |FBSD_MEM=2047;506;35;156;239;0;213;4096;0

If using nagiosgraph, then add something like that into map file:
## Service type: freebsd memory
/perfdata:FBSD_MEM=([d]+);([d]+);([d]+);([d]+);([d]+);([d]+);([d]+);d+;([d]+)/
and push @s, [ 'ram',
[ 'total', GAUGE, $1*1024**2 ],
[ 'used', GAUGE, $2*1024**2 ],
[ 'act', GAUGE, $3*1024**2 ],
[ 'inact', GAUGE, $4*1024**2 ],
[ 'wired', GAUGE, $5*1024**2 ],
[ 'cache', GAUGE, $6*1024**2 ],
[ 'buf', GAUGE, $7*1024**2 ] ],
[ 'swap',
[ 'used', GAUGE, $8*1024**2 ] ];