Download details

check_network check_network.php Neu Aktualisiert

Informationen
Erstelldatum 15.02.2021
Änderungsdatum 22.02.2021
Version 1.20210218
Dateigröße 2.51 KB
Downloads 16
Lizenz MIT Lizenz external
Preis Donate PayPal

 

Nagios Plugin to check interface traffic

You need to install php-snmp


/usr/bin/php ./check_network.php -H 192.168.2.211 -V
Array
(
[iso.3.6.1.2.1.31.1.1.1.1.1] => STRING: "lo"
[iso.3.6.1.2.1.31.1.1.1.1.2] => STRING: "enp0s3"
[iso.3.6.1.2.1.31.1.1.1.1.3] => STRING: "enp0s8"
[iso.3.6.1.2.1.31.1.1.1.1.4] => STRING: "enp0s8.111"
)

/usr/bin/php ./check_network.php -H 192.168.2.211 -n 2  -w 80 -c 90
OK - enp0s3 (1000 Mbit/s) - In: 0.09% (113.211 KB/s ) - Out: 0.02% (28.625 KB/s) | IN=0.088%;80.000;90.000;0;100.000 OUT=0.022%;80.000;90.000;0;100.000

/usr/bin/php  ./check_network.php -H 192.168.2.210 -n 3 -m MB -w 80 -c 90
OK - enp0s31f6 (1000 Mbit/s) - In: 0.039 MB/s - Out: 3.964 MB/s| IN=0.039;100.000;112.500;0;125.000 OUT=3.964;100.000;112.500;0;125.000

/usr/bin/php ./check_network.php -H 192.168.2.210 -n 3 -m MB -w 80 -c 90
WARNING - enp0s31f6 (1000 Mbit/s) - In: 0.736 MB/s - Out: 106.998 MB/s| IN=0.736;100.000;112.500;0;125.000 OUT=106.998;100.000;112.500;0;125.000

/usr/bin/php  ./check_network.php -H 192.168.2.210 -n 3 -m Kb -w 80 -c 90
OK - enp0s31f6 (1000 Mbit/s) - In: 3726.530 Kbit/s - Out: 544517.553 Kbit/s| IN=3726.530Kbit;800000.000;900000.000;0;1000000.000 OUT=544517.553Kbit;800000.000;900000.000;0;1000000.00 


Usage: /usr/bin/php check_network.php -H [HOST] -P [snmp_version] -n [node] ( -m [output/perfdata] -w [Warning] -c [Critical] -v (debug) -V (snmp debug))

snmp_version - 2 -C [community string] (default -C public)
               3 -u [user] -p [password] -a [auth. prot. (MD5/SHA] ( -x [priv. proto. (DES/AES) -X [priv. password])

             -n node - network node

             -m output/perfdata b=bit
                                Kb=Kbit
                                Mb=Mbit
                                B=Byte
                                KB=KByte
                                MB=MByte
                                %=percent and KByte/MByte (default)

             -w warning percent
             -c critical percent

network

Changelog

Version 1.2021018
Typo correction


Version 1.20210217
add -m output/perfdata


Version 1.20210215
First Release