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

check_snmp_host.sh

Rating
2 votes
Favoured:
2
Current Version
1.2
Last Release Date
2020-03-10
Compatible With
  • Nagios 4.x
Owner
License
GPL
Hits
1162
Files:
FileDescription
check_snmp_host.shcheck_snmp_host.sh
check_snmp_host_pnp4nagios_templates.zipcheck_snmp_host_pnp4nagios_templates.zip
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
This is a Nagios plugin for running basic health checks on a Linux host, via SNMP. Current version can check CPU load, disk usage, system load, memory usage, network traffic, process details, number of running processes, swap usage, timedrift, uptime and logged in users.
I created pnp4nagios templates for graphs, their usage is completely optional, and you can download them here as well.
To use the graph templates, you have to copy them to the templates folder of your pnp4nagios installation - for example: /usr/share/pnp4nagios/share/templates. The templates are selected by name, meaning the template file name must match the Nagios check name you use in /etc/nagios/objects/commands.cfg. If you called your check as "check_snmp_host_net", then it will try to use the template file called check_snmp_host_net.php.

The current version is capable running the following checks:

- cpu: CPU load percentage. Use the provided template to get a stacked graph in pnp4nagios. The stacked graph will show user, system, kernel, nice and wait times with different colors. On multi-processor systems this will display the average load of all processors.

- disk: Disk usage in percentage. Use the -m flag to specify the mountpoint. The root partition is, for example: -m /

- load: System load averages for 1 minute, 5 minutes and 15 minutes.
The provided pnp4nagios template will combine the three data into a single graph. Warning and critical thresholds should contain values for each of them, separated by commas. For example: -w 5,4,3 -c 9,8,7

- mem: Memory usage (percentage). Use the provided template to get a stacked graph in pnp4nagios. The stacked graph will show used, buffer and cache memory with different colors. Alerting will happen when the real usage (used memory) will reach a threshold.

- net: Network traffic (in packets). Graphs are in megabytes (MB). Use the -n flag to specify the network interface you want to monitor. Use the provided template to get a combined (in/out) traffic graph in pnp4nagios. Don't set -w or -c, this check is just for traffic display and visualization.

- proc: Detailed information of a process. Use the -p flag to specify the process name, for example: -p httpd. You will get CPU and memory usage graphs, and can set warning/critical levels for the memory usage (in MB). You will get a critical alert if the number of running instances is 0 (zero).

- procs: The total number of currently running processes.

- swap: Swap space usage (percentage).

- time: Timedrift compared to the Nagios server system time. Warning and critical levels are in seconds. Use only absolute numbers (for example, 5 instead of -5).

- uptime: System uptime. This is just for information display, do not set -w or -c.

- users: The number of active user sessions.

If you have requests/issues, please post them here on Nagios Exchange.
Reviews (1)
The plugins works greats but i have a problem to populate the graphics, can you help me, I create the command definitions and create a check_command definition in PNP4Nagios but dont populate the graphics.
Owner's reply

Sorry for the late reply, I forgot to check this page.
If you have problems with your pnp4nagios setup, this is a great help: https://docs.pnp4nagios.org/pnp-0.6/start

If pnp4nagios actually works, but my plugin does not show graphs, it is important to know that you need to set "RRD_STORAGE_TYPE = MULTIPLE" in process_perfdata.cfg. I forgot to mention this in my original post.