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

check_sysctl

Rating
0 votes
Favoured:
0
Hits
98166
Files:
FileDescription
check_sysctl-1.2.tar.gzVersion 1.2
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!
This PERL-based plugin monitors the value/string of a particular Linux/*BSD kernel sysctl oid you specify. You can even compare the value of one oid against that of another oid!
This plugin checks sysctl oid statistics in a Linux/*BSD kernel!
The script is incredibly flexible, to the point of featuritis.
You will need PERL installed on your system. If running this script in Linux, you may need to execute this plugin with sudo. Please check Nagios documentation for how to implement this.

Usage: check_sysctl (sysctl oid) (comparison oid/self) [lt/gt/eq/ne/pc [(warn value/string)[(crit value/string)]]]

Basic usage involves selecting a specific sysctl to monitor. The oid and it's value will be shown in Nagios' report window. Alerts are never produced if only checking the status of an oid.

Example (simply show an oid value - will never produce an alert)
# check_sysctl kern.maxvnodes
OK kern.maxvnodes: 69131

Optionally, you can specify if you wish to do a compare the value of your selected oid, and produce an alert if it fluctuates into values you find objectionable.

To do this, first you must add another oid to compare against (or you may give the argument "self" to check against your initial oid's value), and follow this with a modifier. The modifier will be used to make a value comaprison.

These modifiers can be one of the following:-

*** lt - less than, gt - greater than ***

If checking against your primary oid's value, an a warning value is required and an error is produced should the primary oid's value exceed the limit of this value.

Example (produce a warning when vfs.numvnodes exceeds 60000)
# check_sysctl vfs.numvnodes self gt 60000
WARNING vfs.numvnodes: 61039 (greater than 60000)

When checking against another oid's value, the warning values will increase or decrease the oid's values with alert values you provide, and an alert will be produced if the range is exceeded.
If a warning value is not provided, a warning will occur should the primary oid's value cross the threshold of the value of the second. If you want to ensure that such an error goes critical, give both warning and critical values a value of 0.

Example (produce an warning if the primary oid is less than 5000 from the value of the second oid, and go critical if it is 10000 less.)
# check_sysctl vfs.numvnodes kern.maxvnodes lt 5000 10000
WARNING vfs.numvnodes: 61502 (less than 64131 [ kern.maxvnodes: 69131 ])


*** eq - equal to, ne - not equal to ***

If checking against your primary oid's value, a warning value is required and an error will be produced should the values match/not match as the case may be. A critical value can be additionally provided. Having both warning and ciritical values identical will ensure that only critical alerts are produced

Example (produce a warning should vfs.numvnodes equal 61052 and go critical should it equal 61050)
# check_sysctl vfs.numvnodes self eq 61052 61050
OK vfs.numvnodes: 61091 (not equal to 61052 / 61050)

If checking against a secondary oid, warning values and critical values are not necessary at all. However, should you wish the alert to be a critical alert and not a warning (which is the default with no alert values), provide both random warning and critical values.

Example (go critical should vfs.numvnodes not equal kern.maxvnodes)
# check_sysctl vfs.numvnodes kern.maxvnodes ne 0 0
CRITICAL vfs.numvnodes: 61091 (not equal to 69131 [ kern.maxvnodes: 69131 ])

*** pc - percentage of ***

A percentage check can ONLY be done with a secondary oid. If you do not provide one, you will be advised of a syntax error. The warning values will be calculated as a percentage of the secondary value, and set the value alert limits accordingly. Percentages may exceed 100% if you so desire.

Example (produce a warning should vfs.numnodes reach 80% of kern.maxvnodes)
# check_sysctl vfs.numvnodes kern.maxvnodes pc 80
WARNING vfs.numvnodes: 61091 ( greater than 55304.8 [ kern.maxvnodes: 69131 ])

Please alert me of any bugs, feature requests.