#!/usr/bin/php -o \n"; exit (1); } $SWAPS['DATE'] = date ('d.m.y'); $SWAPS['TIME'] = date ('H.i'); echo "OK, please paste in the output from your Cisco device\n"; echo " (show snmp mib ifmib ifindex):\n"; $interfaces = array (); $started = false; while ((($str = trim (fgets (STDIN))) !== '') || !$started) { if ($str != '') $started = true; $ifname = str_replace ('/', '_', substr ($str, 0, strpos ($str, ':'))); $ifindex = substr ($str, strpos ($str, '= ') + 2); $interfaces[$ifindex] = $ifname; } ksort ($interfaces); ob_start (); // ********************************* // Output starts here ... feel free to modify anything here after :) ?> 0 0.0.0.0 10050 3 Templates ping 60 30 365 0 0 0 0 161 0 $ifname): ?> ifInOctets. 30 30 365 0 Bits 8 1 8 0 public 1.3.6.1.2.1.2.2.1.10. 161 0 $ifname): ?> ifOutOctets. 30 30 365 0 Bits 8 1 8 0 public 1.3.6.1.2.1.2.2.1.16. 161 0 $ifname): ?> ifInUcastPkts. 90 30 365 0 pps 0 1 0 public 1.3.6.1.2.1.2.2.1.11. 161 0 $ifname): ?> ifOutUcastPkts. 90 30 365 0 pps 0 1 0 public 1.3.6.1.2.1.2.2.1.17. 161 0 $ifname): ?> ifInBroadcastPkts. 90 30 365 0 pps 0 1 0 public 1.3.6.1.2.1.31.1.1.1.3. 161 0 $ifname): ?> ifOutBroadcastPkts. 90 30 365 0 pps 0 1 0 public 1.3.6.1.2.1.31.1.1.1.5. 161 0 $ifname): ?> ifInMulticastPkts. 90 30 365 0 pps 0 1 0 public 1.3.6.1.2.1.31.1.1.1.2. 161 0 $ifname): ?> ifOutMulticastPkts. 90 30 365 0 pps 0 1 0 public 1.3.6.1.2.1.31.1.1.1.4. 161 0 $ifname): ?> ifInUcastPkts. 90 30 365 0 pps 0 1 0 public 1.3.6.1.2.1.2.2.1.11. 161 0 $ifname): ?> ifOutUcastPkts. 90 30 365 0 pps 0 1 0 public 1.3.6.1.2.1.2.2.1.17. 161 0 $ifname): ?> ifOperStatus. 120 7 365 0 0 0 0 public 1.3.6.1.2.1.2.2.1.8. 161 0 $ifname): ?> ifAdminStatus. 300 30 365 0 0 0 0 public 1.3.6.1.2.1.2.2.1.7. 161 0 Host unreachable 0 {{HOSTNAME}:icmpping.last(0)}#1 0 1 Host unreachable $ifname): ?> Link down on 0 ({{HOSTNAME}:ifOperStatus..last(0)}=2)&({{HOSTNAME}:ifAdminStatus..last(0)}=1) 0 2 Link down on $ifname): ?> 0 0 1 1 0 0.0000 0 0 95.0000 95.0000 0 1 0000FF 1 2 0 5 1 0 009900 1 2 0 5 $ifname): ?> 0 0 1 1 0 0.0000 100.0000 0 0 0.0000 0.0000 2 0 000099 1 2 0 5 2 1 009900 1 2 0 5 2 2 990000 1 2 0 5 2 3 0000CC 1 2 0 5 2 4 00CC00 1 2 0 5 2 5 CC0000 1 2 0 5