#!/usr/bin/php Usage: -C= -H= [-n=] Actions: -h, --help show this help net -g number of interfaces -s current operational status of this iface -i input traffic in bps of this iface -o output traffic in bps of this iface -bw bandwidth in bps of this iface -u current bandwidth usage in % if this iface (full duplex) sai -mgbc Merlin Gerin - Battery charge in % misc -v, --version show version Options are parsed in this order. More than one option will execute only one action (first found). Options: -w= warning limit (valid for -i, -o, -u) (use 2 comma separated values [in,out] for -u) -c= critical limit (valid for -i, -o, -u) (use 2 comma separated values [in,out] for -u) --neg negate the return code (valid for -s) -D Debug into /tmp/get_snmp.txt file Examples: To get the bandwidth usage for one interface: ./get_snmp.php -C=public -H="10.0.1.1" -n="FastEthernet0/23" -u -c="30.5" will return: bandwidth usage (in,out) for FastEthernet0/23: 30.88%,24.43% - CRITICAL (0.30) Return status: - Without warning nor critical values: exit code 0: indicates that request was successfully. exit code 1: indicates that request was not successfully. - If a warning or a critical value is specified: exit code 0: OK exit code 1: WARNING exit code 2: CRITICAL exit code 3: UNKNOWN, OTHER