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_network.py

Rating
3 votes
Favoured:
0
Current Version
1
Last Release Date
2013-03-01
Compatible With
  • Nagios 3.x
Owner
License
GPL
Hits
47262
Files:
FileDescription
check_network.pycheck_network_plugin
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!
check_network.py
This is my first script to check the network traffic for linux.

Minimum required python 2.4
This plugin check the traffic in and out for linux.

Minimum required python 2.4

example: ./check_network.py eth0
NETWORK USAGE Taffic_in:4.82Mbits/s traffic_out:734.62Kbits/s | traffic_in=5050011.2Bits/s traffic_out=752252.8Bits/s
Reviews (2)
This plugins worked well but generating separate bandwidth graphs of Linux "eth0" interface. Below is my configuration.

####Nagios Server####
define service{
use generic-service
host_name mail.example.local
service_description eth0 Network
check_command check_nrpe!eth0_network
check_interval 1
}

####NRPE Client####
vim /usr/local/nagios/etc/nrpe.cfg

command[eth0_network]=/usr/local/nagios/libexec/check_network.py eth0
#############################

-Nishith N.Vyas
Most plugins are used in enterprise environments where nagios user does not have root or sudo privileges. ifconfig cannot be run in such environments which makes the plugin unusable.

You can do almost the same code, but get the byte and packet readings from /sys/class/net/eth0/statistics. Using this method you will not need the subprocess library. Make it more simple and usable.