WISP Broadband is a small, community-oriented wireless ISP based in Ickford, Buckinghamshire, England.
Started in 2002 and operational in 2003, the project is being wound down in 2008 for a few reasons, mainly that 2 of the 3 co-founders have moved away and can no longer support customers.
This archive seeks to publish and preserve the information generated within the project for wider benefit. This includes software, configuration files and documentation. The WISP sincerely wishes it will benefit others.
Business
Operations
Marketing
An internal card for an APC UPS which provides a management interface (http, https, telnet, shh, ftp, snmp, syslogs, and so on).
Use the admin password for all management connections. To restore to factory default, use a bent paperclip to press the recessed reset button on the card. There is no default IP address. Default username & password are apc and apc.
Configuration from factory default can be done via a trick with arp and a specific-sized ping message. You will need the card’s MAC address:
$ arp -s 10.0.0.42 0:c0:b7:6d:8c:ff
Password:
$ ping -s 113 10.0.0.42
PING 10.0.0.42 (10.0.0.42): 113 data bytes
121 bytes from 10.0.0.42: icmp_seq=0 ttl=255 time=37.714 ms
121 bytes from 10.0.0.42: icmp_seq=1 ttl=255 time=2.102 ms
121 bytes from 10.0.0.42: icmp_seq=2 ttl=255 time=1.869 ms
^C
--- 10.0.0.42 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 1.869/13.894/37.714 ms
$ telnet 10.0.0.42
Trying 10.0.0.42...
Connected to 10.0.0.42.
Escape character is '^]'.
User Name : apc
Password : ***
American Power Conversion Network Management Card AOS v2.1.1
(c) Copyright 2002 All Rights Reserved Smart-UPS & Matrix-UPS APP v2.1.0
------------------------------------------------------------------------------
Name : Unknown Date : 11/02/2000
Contact : Unknown Time : 23:56:42
Location : Unknown User : Administrator
Up Time : 0 Days 0 Hours 7 Minutes Stat : P+ N+ A+
Smart-UPS 1400 named UPS_IDEN : Off
------- Control Console ------------------------------------------------------
1- Device Manager
2- Network
3- System
4- Logout
- Main Menu, - Refresh, - Event Log
>
% ssh -l wisp 10.0.0.42 Authenticated with partial success. wisp@10.0.0.42's password:American Power Conversion Network Management Card AOS v2.1.1 (c) Copyright 2002 All Rights Reserved Smart-UPS & Matrix-UPS APP v2.1.0 ------------------------------------------------------------------------------ Name : NET_WRM_UPS1 Date : 01/16/2005 Contact : info@wispbroadband.co.uk Time : 08:34:51 Location : Worminghall User : Administrator Up Time : 1 Day 1 Hour 11 Minutes Stat : P+ N+ A+ Smart-UPS 1000 named UPS_IDEN : On Line ------- Control Console ------------------------------------------------------ 1- Device Manager 2- Network 3- System 4- Logout - Main Menu, - Refresh, - Event Log > 1 ------- Device Manager ------------------------------------------------------- 1- Smart-UPS 1000 - Back, - Refresh, - Event Log > 1 ------- Smart-UPS 1000 ------------------------------------------------------- Status of UPS : On Line Last Transfer : Detection of a line voltage notch or spike. ---------------------------------------------------------------------- Input Voltage : 237.9 VAC Operating Frequency : 50.00 Hz Output Voltage : 237.9 VAC Internal Temperature: 032.4 C Load Power : 009.3 % Watts Battery Voltage : 27.74 VDC Max Line Voltage : 240.5 VAC Battery Capacity : 100.0 % Min Line Voltage : 235.3 VAC Runtime Remaining : 0128 min ---------------------------------------------------------------------- Self-Test Result : Passed Calibration Result : Unknown Self-Test Date : 01/15/2005 Calibration Date : Unknown 1- Control 2- Diagnostics 3- Configuration 4- Detailed Status 5- About UPS - Back, - Refresh, - Event Log > ------- Device Manager ------------------------------------------------------- 1- Smart-UPS 1000 - Back, - Refresh, - Event Log > ------- Control Console ------------------------------------------------------ 1- Device Manager 2- Network 3- System 4- Logout - Main Menu, - Refresh, - Event Log > 4Connection to 10.0.0.42 closed by remote host. Connection to 10.0.0.42 closed. %
Supported MIBs: MIB-II (RFC-1213), APC PowerNet MIB. Default community ‘passwords’ are public (RO) and private (RW).
http://www.proxim.com/
http://www.avaya.com/
Management access is via HTTP or HTTPS, telnet or SSH2, and SNMP. Passwords may be set for each class of access. Default IP address is 10.0.0.1, password is public. To restore to factory defaults, press & hold the reload button for 10secs.
Secure management login may be enabled which supports secure protocols (HTTPS & SSH) in place of insecure ones (HTTP, telnet). First enable secure access, setting a passphrase then reboot, after which the AP generates the appropriate keys:
Dec 13 11:48:21 10.0.0.15 SSH cannot load Host Keys. Starting internal key generation now. Dec 13 11:49:37 10.0.0.15 Generated SSH keys.
Since this process includes a reboot and a lengthy key generation step, this action requires a maintenance window.
The AP-2000 has a pretty web interface, but one quickly discovers that the AP throttles the CPU power it will apply to drive this output and moving around the web GUI can be very slow, and is the reason why using deep links (links direct to the page you want) is such a good idea.
The AP-2000 also has a very capable command line interface (i.e. available via telnet or SSH) presenting a practical, but most importantly, fast interface. Here are some useful examples:
# telnet 10.0.0.15 Trying 10.0.0.15... Connected to 10.0.0.15 (10.0.0.15). Escape character is '^]'. [WISP-WRN2]> Please enter password:** Welcome to Command Line Interface - Version 2.5.2(894) ** Please type help for a description on commands and parameters. [WISP-WRN2]> help Type ? at the command prompt for a command list. Complete command description and command usage can be provided by: help help Special keys supported: Arrow Keys DEL, BS .... delete previous character Ctrl-A .... go to beginning of line Ctrl-E .... go to end of line Ctrl-F .... go forward one character Ctrl-B .... go backward one character Ctrl-D .... delete current character Ctrl-U, X .. delete to beginning of line Ctrl-K .... delete to end of line Ctrl-W ..... delete previous word Ctrl-T ..... transpose previous character Ctrl-P .... go to previous line in history buffer Ctrl-N .... go to next line in history buffer Tab .... will attempt command completion # .... Comment Character ? .... will provide command listing Examples: '?' list all the supported commands 'sh?' list all commands that start with sh 'show ?' list all arguments to the show command 'sh ' complete the 'show' command [WISP-WRN2]>exitConnection closed by foreign host.
This examples assumes the software image file is already available via TFTP from the NMS.
[WISP-WRN2]> download 10.0.0.2 AP3_R252.bin img File AP3_R252.bin is being downloaded from 10.0.0.2. File AP3_R252.bin has been downloaded successfully.
Which generates the following syslog:
Dec 13 11:08:11 10.0.0.15 Image download successful, previous image deleted.
[WISP-WRN2]> reboot 0
Uploads the AP configuration via TFTP to the NMS with the filename specified:
[WISP-ICK1]> upload 10.0.0.2 ICK1-090405.cfg config File ICK1-090405.cfg is being uploaded to 10.0.0.2. File ICK1-090405.cfg has been uploaded successfully.
[WISP-ICK1]> show system System Parameters ================= sysname : WISP-ICK1 sysloc : Ickford1 sysctname : Technical Director sysctemail : info@wispbroadband.co.uk sysctphone : Contact Phone Number sysuptime (DD:HH:MM:SS) : 6:13:19:24 sysoid : 1.3.6.1.4.1.11898.2.4.6 sysdescr : Avaya AP-3 v2.4.11(821) SN-03UT02560343 v2.0.10 sysservices : 2 sysflashupdate : 0 sysflashbckint : 120 sysresettodefaults : 0 syscountrycode :
[WISP-ICK1]> show statmss Number of clients : 15 MAC-Address IP-Address Interface STA-Type Proto SNR TSLF ---------------------------------------------------------------------------- 00:30:1A:0B:05:64 10.0.0.65 3 STA 802.11b 6 1800 00:30:1A:0B:05:A3 10.0.0.55 3 STA 802.11b 18 900 00:30:1A:0B:06:8F 10.0.0.58 3 STA 802.11b 31 15400 00:30:1A:0B:07:F6 10.0.0.63 3 STA 802.11b 9 2400 00:30:1A:0B:07:F8 10.0.0.56 3 STA 802.11b 7 0 00:30:1A:0B:07:F9 10.0.0.59 3 STA 802.11b 11 3200 00:30:1A:0B:08:34 10.0.0.66 3 STA 802.11b 35 26300 00:30:1A:0B:08:78 192.168.10.103 3 STA 802.11b 14 100 00:30:1A:0B:09:9F 10.0.0.62 3 STA 802.11b 36 2900 00:30:1A:0B:09:9B 10.0.0.61 3 STA 802.11b 18 27200 00:30:1A:0B:0A:12 10.0.0.60 3 STA 802.11b 9 4400 00:30:1A:0B:0A:0B 10.0.0.67 3 STA 802.11b 24 4500 00:30:1A:0A:FD:B8 10.0.0.52 3 STA 802.11b 21 1400 00:30:1A:0A:FE:AE 10.0.0.50 3 STA 802.11b 12 0 00:02:2D:66:6A:44 0.0.0.0 4 WDS 802.11b 33 0
Dec 19 05:27:52 localhost snmptrapd[3719]: 10.0.0.13 [10.0.0.13]: Trap SNMPv2-MIB::sysUpTime = Timeticks: (29447982) 3 days, 9:47:59.82, SNMPv2-MIB::snmpTrapOID = OID: SNMPv2-SMI::enterprises.11898.2.1.18.7.2, SNMPv2-SMI::enterprises.11898.2.1.18.1.3 = IpAddress: 10.0.0.2, SNMPv2-SMI::enterprises.11898.2.1.18.1.4 = STRING: "AP3_R252.bin", SNMPv2-SMI::enterprises.11898.2.1.18.1.5 = INTEGER: 3, SNMPv2-MIB::snmpTrapEnterprise = OID: SNMPv2-SMI::enterprises.11898.2.1 Dec 19 05:29:41 10.0.0.13 Image download successful previous image deleted Dec 19 05:29:41 localhost snmptrapd[3719]: 10.0.0.13 [10.0.0.13]: Trap SNMPv2-MIB::sysUpTime = Timeticks: (29458892) 3 days, 9:49:48.92, SNMPv2-MIB::snmpTrapOID = OID: SNMPv2-SMI::enterprises.11898.2.1.18.7.3, SNMPv2-SMI::enterprises.11898.2.1.18.1.3 = IpAddress: 10.0.0.2, SNMPv2-SMI::enterprises.11898.2.1.18.1.4 = STRING: "AP3_R252.bin", SNMPv2-SMI::enterprises.11898.2.1.18.1.5 = INTEGER: 3, SNMPv2-MIB::snmpTrapEnterprise = OID: SNMPv2-SMI::enterprises.11898.2.1 Dec 19 05:29:49 localhost snmptrapd[3719]: 10.0.0.13 [10.0.0.13]: Trap SNMPv2-MIB::sysUpTime = Timeticks: (29459692) 3 days, 9:49:56.92, SNMPv2-MIB::snmpTrapOID = OID: SNMPv2-SMI::enterprises.11898.2.1.18.5.5, SNMPv2-SMI::enterprises.11898.2.1.18.5.5 = IpAddress: 10.0.0.2, SNMPv2-MIB::snmpTrapEnterprise = OID: SNMPv2-SMI::enterprises.11898.2.1
Dec 6 08:22:30 localhost snmptrapd[3679]: 10.0.0.11: Enterprise Specific Trap (8) Uptime: 2 days, 21:25:23.11, SNMPv2-SMI::enterprises.11898.2.1.18.1.1 = STRING: "Crash of 802.11b mac services on CardB:Rebooting the System" Dec 6 08:22:32 localhost snmptrapd[3679]: 10.0.0.11: Enterprise Specific Trap (5) Uptime: 2 days, 21:25:25.11 Dec 6 08:22:34 localhost snmptrapd[3679]: 10.0.0.11: Enterprise Specific Trap (5) Uptime: 2 days, 21:25:26.61 Dec 6 08:23:17 localhost snmptrapd[3679]: 10.0.0.11: Cold Start Trap (0) Uptime: 0:00:00.00 Dec 6 08:23:17 localhost snmptrapd[3679]: 10.0.0.11: Link Up Trap (0) Uptime: 0:00:00.00 Dec 6 08:23:17 localhost snmptrapd[3679]: 10.0.0.11: Link Up Trap (1) Uptime: 0:00:00.00 Dec 6 08:23:17 localhost snmptrapd[3679]: 10.0.0.11: Link Up Trap (2) Uptime: 0:00:00.00 Dec 6 08:23:17 localhost snmptrapd[3679]: 10.0.0.11: Link Up Trap (3) Uptime: 0:00:00.00 Dec 6 08:23:22 localhost snmptrapd[3679]: 10.0.0.11: Warm Start Trap (0) Uptime: 0:00:05.10 Dec 6 08:23:52 localhost snmptrapd[3679]: 10.0.0.11: Enterprise Specific Trap (2) Uptime: 0:00:34.60, SNMPv2-MIB::sysUpTime = Timeticks: (3400) 0:00:34.00, SNMPv2-MIB::snmpTrapOID = OID: SNMPv2-SMI::mib-2.17.2.1.3
Dec 11 14:14:00 10.0.0.11 00-30-1a-0b-0f-49 ACCESS CONTROL LIST MANAGER: ACCESS ALLOW Dec 10 12:40:15 10.0.0.14 00-04-23-91-a1-19 ACCESS CONTROL LIST MANAGER: ACCESS REJECT
The Search function in SimpleMonitor sends out an SNMP broadcast that generates a harmless, but possibly annoying, trap from each AP3:
Dec 16 10:21:35 localhost snmptrapd[3719]: 10.0.0.14: Enterprise Specific Trap (3) Uptime: 1 day, 7:47:48.40, SNMPv2-SMI::enterprises.11898.2.1.18.3.3 = IpAddress: 10.0.0.244 Dec 16 10:21:35 localhost snmptrapd[3719]: 10.0.0.13 [10.0.0.13]: Trap SNMPv2-MIB::sysUpTime = Timeticks: (5290938) 14:41:49.38, SNMPv2-MIB::snmpTrapOID = OID: SNMPv2-SMI::enterprises.11898.2.1.18.3.3, SNMPv2-SMI::enterprises.11898.2.1.18.3.3 = IpAddress: 10.0.0.244, SNMPv2-MIB::snmpTrapEnterprise = OID: SNMPv2-SMI::enterprises.11898.2.1 Dec 16 10:21:35 localhost snmptrapd[3719]: 10.0.0.12: Enterprise Specific Trap (3) Uptime: 1 day, 7:59:03.59, SNMPv2-SMI::enterprises.11898.2.1.18.3.3 = IpAddress: 10.0.0.244 Dec 16 10:21:35 localhost snmptrapd[3719]: 10.0.0.11: Enterprise Specific Trap (3) Uptime: 2 days, 15:20:59.14, SNMPv2-SMI::enterprises.11898.2.1.18.3.3 = IpAddress: 10.0.0.244 Dec 16 10:21:35 localhost snmptrapd[3719]: 10.0.0.10: Enterprise Specific Trap (3) Uptime: 10:41:41.58, SNMPv2-SMI::enterprises.11898.2.1.18.3.3 = IpAddress: 10.0.0.244
Nov 26 09:48:22 localhost snmptrapd[3679]: 10.0.0.13 [10.0.0.13]: Trap SNMPv2-MIB::sysUpTime = Timeticks: (12184839) 1 day, 9:50:48.39, SNMPv2-MIB::snmpTrapOID = OID: SNMPv2-SMI::enterprises.11898.2.1.18.3.3, SNMPv2-SMI::enterprises.11898.2.1.18.1.1 = STRING: "Invalid password entered at 192.168.10.102", SNMPv2-MIB::snmpTrapEnterprise = OID: SNMPv2-SMI::enterprises.11898.2.1
Dec 13 11:48:21 10.0.0.15 SSH cannot load Host Keys. Starting internal key generation now. Dec 13 11:49:37 10.0.0.15 Generated SSH keys.
# Description 1 A coldStart trap signifies that the SNMPv2 entity, acting in an agent role, is reinitializing itself and that its configuration may have been altered 2 A warmStart trap signifies that the SNMPv2 entity, acting in an agent role, is reinitializing itself such that its configuration is unaltered 3 linkDown 4 linkUp 5 An authenticationFailure trap signifies that the SNMPv2 entity, acting in an agent role, has received a protocol message that is not properly authenticated. While all implementations of the SNMPv2 must be capable of generating this trap, the snmpEnableAuthenTraps object indicates whether this trap will be generated
Examples
Sep 7 17:12:37 localhost snmptrapd[23156]: 10.0.0.11: Enterprise Specific Trap (3) Uptime: 7 days, 17:08:39.09, SNMPv2-SMI::enterprises.11898.2.1.18.3.3 = IpAddress: 10.0.0.244 OID=enterprises.agere.orinoco.orinocoObjects.orinocoTrap.OriSecurityTraps. oriTrapUnauthorizedManagerDetected
Could be an un-authorised attempt to access the AP but in this case is just the broadcast message from a SimpleMonitor search action. Note the source IP address that permits identification of the originator.
Sep 7 12:17:53 localhost snmptrapd[23156]: 10.0.0.10: Enterprise Specific Trap (8) Uptime: 1:17:47.09, SNMPv2-SMI::enterprises.11898.2.1.18.1.1 = STRING: "Crash of 802.11b mac services on CardA:Rebooting the System" OID=enterprises.agere.orinoco.orinocoObjects.orinocoTrap.oriTrapVariable. oriGenericTrapVariable
Internal software failure on Access Point causing a reboot.
Sep 7 12:17:55 localhost snmptrapd[23156]: 10.0.0.10: Enterprise Specific Trap (5) Uptime: 1:17:49.09 Sep 7 12:18:44 localhost snmptrapd[23156]: 10.0.0.10: Cold Start Trap (0) Uptime: 0:00:00.00
Standard RFC-1215 trap indicating the device has restarted.
Sep 7 12:18:44 localhost snmptrapd[23156]: 10.0.0.10: Link Up Trap (0) Uptime: 0:00:00.00
Standard RFC-1215 trap indicating a link has come up, 0=Ethernet.
Sep 7 12:18:44 localhost snmptrapd[23156]: 10.0.0.10: Link Up Trap (1) Uptime: 0:00:00.00
Standard RFC-1215 trap indicating a link has come up, 0=Wireless-A.
Sep 7 12:18:44 localhost snmptrapd[23156]: 10.0.0.10: Link Up Trap (2) Uptime: 0:00:00.00 Sep 7 12:18:44 localhost snmptrapd[23156]: 10.0.0.10: Link Up Trap (3) Uptime: 0:00:00.00 Sep 7 12:18:49 localhost snmptrapd[23156]: 10.0.0.10: Enterprise Specific Trap (1) Uptime: 0:00:05.07, SNMPv2-SMI::enterprises.11898.2.1.18.1.18 = INTEGER: 2 OID=enterprises.agere.orinoco.orinocoObjects.orinocoTrap.oriTrapVariable. oriTrapVarWirelessCard Card-A=1, Card-B=2.
• Cisco
• MIB
• Cisco Tools
The router supports http: and telnet. There is no default IP address and initial configuration must be done via the serial port (9600baud NS1).
A notable omission is any secure (encrypted) protocol which means all communications may be sniffed for passwords. The only safe method is the serial console port. Remotely, the least worst method is to login to the NMS (via SSH), then telnet from there.
Router suports three (3) ADSL modems running in multi-link PPP mode.
C2610#show startup-config Using 2348 out of 29688 bytes ! ! Last configuration change at 15:49:39 BST Wed Jun 1 2005 ! NVRAM config last updated at 16:17:09 BST Wed Jun 1 2005 ! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname C2610 ! boot-start-marker boot-end-marker ! enable secret 5 $1$XmXA$2ZSJdTuV2aV9ZAnzFZmJt/ enable password dQ6P7dH71NAwD7njIIzf ! clock timezone GMT 0 clock summer-time BST recurring no network-clock-participate slot 1 no network-clock-participate wic 0 no aaa new-model ip subnet-zero ip cef ! ! ! ip ftp username wispers ip ftp password J2nMo2fxKXyOXd8K7u1p ip name-server 213.208.106.212 ip name-server 213.208.106.213 no ftp-server write-enable ! ! ! ! interface ATM0/0 description 01844 339057 | briss1@gotadsl.co.uk | 81.6.252.21 no ip address no atm ilmi-keepalive dsl operating-mode auto pvc 0/38 encapsulation aal5mux ppp dialer dialer pool-member 1 ! ! interface FastEthernet0/0 ip address 84.12.108.98 255.255.255.240 speed auto half-duplex no cdp enable no mop enabled ! interface ATM0/1 description 01844 339062 | briss2@gotadsl.co.uk | 81.6.252.74 no ip address no atm ilmi-keepalive dsl operating-mode auto pvc 0/38 encapsulation aal5mux ppp dialer dialer pool-member 1 ! ! interface ATM1/0 description 01844 339064 | briss3@gotadsl.co.uk | 81.6.252.78 no ip address no atm ilmi-keepalive dsl operating-mode auto pvc 0/38 encapsulation aal5mux ppp dialer dialer pool-member 1 ! ! interface Dialer0 ip address negotiated ip accounting output-packets encapsulation ppp dialer pool 1 dialer persistent dialer-group 1 ppp authentication chap callin ppp chap hostname gotadsl.co.uk/brissbon-ml ppp chap password 0 druv6gey ppp multilink ppp multilink fragment disable ! ip classless ip route 0.0.0.0 0.0.0.0 Dialer0 ip http server ! logging origin-id string C2610 logging source-interface FastEthernet0/0 logging 84.12.108.100 dialer-list 1 protocol ip permit snmp-server community KxAl5GhEiXdYZi6rkARY RO snmp-server ifindex persist snmp-server location Worminghall snmp-server contact info@wispbroadband.co.uk snmp-server enable traps tty snmp-server host 84.12.108.100 public ! line con 0 exec-timeout 0 0 line aux 0 line vty 0 4 password em5mPCmVBKlajtXWXFkZ login ! ntp clock-period 17208405 ntp server 66.187.233.4 ! ! end
This document based on firmware version: 3.3.1130_build_1082
The router supports https (port 443) and ssh (port 22). Default IP address is 192.168.1.1. Use the admin_passwd command to change the console’s factory default (admin / 123456). To restore to factory default, login to console and use restore command.
The web GUI only works fully with MS-IE running on Windows and any other combination is implicated in web GUI lockups. Other browsers and platforms permit the query of most things and even the addition of new data, but editing existing config or looking at dynamic status (such as WAN Status link occupancy) will not work.
C1000 console>help Commands Description help this menu quit or exit quit setpassSet new password admin_passwd Set admin's new password setlanip Set new Lan port ip version Display current version restore Restore to factory setting reboot Reboot system update Update firmware through tftp ping Ping traceroute Traceroute dig dig, another nslookup tool status show the network status C1000 console>
/ Advance Setup / Advanced Feature / ‘Download’
File is created on local host, for example: config_20040601123020
• all IP addresses: * with network mask 0.0.0.0
• a specific IP address: nn.nn.nn.nn with network mask 255.255.255.255
• whole subnet: nn.nn.nn.0 with network mask 255.255.255.0
• any port (ie protocol): *
The Outbound Policy determines outgoing link selection, including any load sharing scheme. There are default entries for 10.xx.xx.xx and 192.168.10.xx addresses that select Session Based load sharing:
10.0.0.0 | 255.0.0.0 | * | * | * | 0.0.0.0 | IP | Always | Session Based | Nildram (wan ip) | Nildram 192.168.10.0 | 255.255.255.0 | * | * | * | 0.0.0.0 | IP | Always | Session Based | Nildram (wan ip) | Nildram
To assign a user a public IP, define an IP Mapping, e.g.:
81.178.26.170 | 192.168.10.202 | IP
It is hard to test a public IP address. A separate dial-up or other ISP connection permits true Internet-based testing. A ping test can be done from http://www.dnsstuff.com/
The Cyclone firewall is configured to:
• Control access to the Cyclone user interface
• Control access to the NMS
• Control Internet traffic directed to Cyclone public IP addresses
QoS provides a per-user uplink traffic limit to prevent excessive network utilisation. Each user needs an entry, e.g.: Notes: • The LAN port is used for the bc as this represents all the network traffic. • The QoS Status page on the Cyclone gives some information on the effect of QoS as it shows the number of bytes that have passed through each rule. The counts are reset upon a router reboot or a re-initialisation of the QoS sub-system. Be aware that if you want to use the QoS Status to measure total bytes for a user, then you must use schedule Always, as the rule only counts byes when it is active. A Daytime schedule would not count the night time bytes. New user logins are logged, but re-established sessions do not generate these: If IP-address-controlled login is enabled, failure logs generated: Changes to admin passwords: User downloads of the router configuration to their local disk: Changes via the GUI to QoS or firewall settings are recorded: altq provides packet queuing and QoS handling. All such logs are potentially serious internal Cyclone problems: Traffic directed to the ADSL network and broadcast addresses is not routable, generating errors. These errors seem to be associated with internal process restarts and should be investigated: Re-initialisation of a router port; normal as part of router reboot, but indicative of internal problem during normal operation. Firewall problem, possibly mis-configuration or other internal problem. Dropping a single packet is not usually harmful but may well indicate other issues such as routing, incorrect config or internal problems. There are circumstances where fragmented datagrams are unconditionally dropped. TCP packets are dropped if they do not contain at least 20 bytes of TCP header, UDP packets are dropped if they do not contain a full 8 byte UDP header, and ICMP packets are dropped if they do not contain 4 bytes of ICMP header, enough to specify the ICMP type, code, and checksum. These packets are simply logged as “pullup failed” since there may not be enough good data in the packet to produce a meaningful log entry. Bad arp packet: A runt is a packet that is too small. For example, the Ethernet protocol requires that each packet be at least 64 bytes long. Runts are also called “undersize packets”. Conversely, a giant is a packet that's oversize. An IP-SEC packet (probably VPN related) coming from the public Internet that has no NAT mapping. Possible causes: Bad arp packet: usually caused by corrupted packets arriving at the router. Packet from Internet has no NAT mapping and is discarded. May be followed by an arpwatch event: Unknown internal fault, possibly due to log files becoming very large and filling the RAM disk allocated to them. Does not seem to affect through traffic but once started, it generates many such logs. A router reboot stops the logs but will not cure the underlying issue. Supported MIBs: MIB-II (RFC 1213)
192.168.10.103 | 255.255.255.255 | * | * | 0.0.0.0 | * | IP | 15000 | Always | LAN
• In this example 150kbps is used. In practice, this is so high as to hardly represent any constriction at all. Where a user needs constraining, then 70kbps applies moderate restraint and 40kbps is quite a lot.
• This example uses the default schedule Always, meaning the rule is permanently in effect. Where a user is being constrained, for example, because of heavy peer-to-peer use, then a Daytime schedule may be appropriate. This will protect the network during normal hours but permit full access to the network during the quiet night hours. Such schedule controlled rules will generate logs at start and stop times:
Sep 26 23:59:01 10.0.0.1 C1000: qos rules deleted
Sep 26 23:59:02 10.0.0.1 C1000: qos initialized
Sep 27 06:01:01 10.0.0.1 C1000: qos rules deleted
Sep 27 06:01:02 10.0.0.1 C1000: qos initialized
• A crucial failure of the QoS Status page is that is doesn’t say when a rule has applied a constraint (delayed or discarded packets) so one must look at MRTG traffic graphs for user traffic information. syslogs
Reboot
Mar 23 06:37:03 10.0.0.1 /kernel: Waiting (max 60 seconds) for system process `vnlru' to stop...stopped
Mar 23 06:37:03 10.0.0.1 /kernel: Waiting (max 60 seconds) for system process `bufdaemon' to stop...
Mar 23 06:37:04 10.0.0.1 /kernel: stopped
Mar 23 06:37:04 10.0.0.1 /kernel: Waiting (max 60 seconds) for system process `syncer' to stop...
Mar 23 06:37:30 10.0.0.1 C1000: LAN activated.
Mar 23 06:37:30 10.0.0.1 /kernel: fxp0: Microcode loaded, int_delay: 1000 usec bundle_max: 6
Mar 23 06:37:30 10.0.0.1 /kernel: fxp0: Microcode loaded, int_delay: 1000 usec bundle_max: 6
Mar 23 06:37:30 10.0.0.1 C1000: LAN activated.
Mar 23 06:37:31 10.0.0.1 /kernel: fxp1: Microcode loaded, int_delay: 1000 usec bundle_max: 6
Mar 23 06:37:31 10.0.0.1 C1000: ISP ADSL1 activated.
Mar 23 06:37:32 10.0.0.1 /kernel: fxp2: Microcode loaded, int_delay: 1000 usec bundle_max: 6
Mar 23 06:37:32 10.0.0.1 C1000: ISP ADSL2 activated.
Mar 23 06:37:33 10.0.0.1 natd: Natd start
Mar 23 06:37:33 10.0.0.1 C1000: High Availability stopped
Mar 23 06:37:33 10.0.0.1 /kernel: fxp1: Microcode loaded, int_delay: 1000 usec bundle_max: 6
Mar 23 06:37:33 10.0.0.1 last message repeated 4 times
Mar 23 06:37:33 10.0.0.1 /kernel: fxp2: Microcode loaded, int_delay: 1000 usec bundle_max: 6
Mar 23 06:37:33 10.0.0.1 last message repeated 2 times
Mar 23 06:37:33 10.0.0.1 C1000: firewall rules added
Mar 23 06:37:33 10.0.0.1 C1000: qos initialized
Mar 23 06:37:33 10.0.0.1 C1000: snmpd started
Mar 23 06:37:33 10.0.0.1 C1000: transparent proxy stoped
Mar 23 06:37:33 10.0.0.1 C1000: proxy stoped
Mar 23 06:37:33 10.0.0.1 C1000: Timezone: Europe/London
Mar 23 06:37:33 10.0.0.1 C1000: vpn server started
Mar 23 06:37:33 10.0.0.1 C1000: vpn initialized
User Login
web[admin:]: User admin logged on
web[admin:]: User wispers attempted to log in from and was denied
Configuration Changes
web[admin:]: Password Settings Saved
web[admin:]: Settings exported to a local file
web[admin:]: firewall Settings Saved
C1000: firewall rules deleted
C1000: firewall rules added
web[admin:]: qos Settings Saved
C1000: qos rules deleted
C1000: qos initialized
web[admin:]: outbound Settings Saved
web[admin:]: Advanced QoS Settings Saved
altq
altqd[932]: syscall error: add filter failed!: Invalid argument
altqd[932]: can't add ctl class IPv6 filter on interface 'fxp0'
altqd[954]: bad filter destination address
altqd[954]: Error in /etc/altq.conf, line 4. config failed.
natd
natd[317]: Drop packet to 81.178.26.175 due to no mac address found
natd[317]: Drop packet to 81.178.26.168 due to no mac address found
natd[317]: Drop packet to 81.178.26.176 due to no mac address found
natd[317]: Drop packet to 81.178.26.183 due to no mac address found
/kernel: fxp1: Microcode loaded, int_delay: 1000 usec bundle_max: 6
/kernel: +++ ipfw: ouch!, skip past end of rules, denying packet
/kernel: pullup failed
Possible causes are broken hardware or malicious behavior./kernel: arp: runt packet
Possible causes included Ethernet collisions (where the runt is the remaining fragment), bad wiring or electrical interference./kernel: IPv4 ESP input: no key association found for spi nnnnnn
• corrupted packet arriving at the router
• broken VPN connection (e.g. client reboot) being re-tried by far end
• Internet worm generating speculative VPN connection attempts/kernel: arp: unknown hardware address format (0xnnnn)
natd[317]: Drop packet to 10.4.70.106 due to no mac address found
localhost arpwatch: new station 10.4.70.106 0:d0:68:2:c4:22
/kernel: pid 65574 (rateup), uid 0 on /: file system full
SNMP
The airBridge only supports access via SNMP and community string is the administrator password. Default IP address is 192.168.0.22, password is public. To restore to factory default, press & hold reset button on PowerShot.
Download from: http://www.smartbridges.com/web/support/ab.asp
.exe file aB Version Notes
1.43 0.09.10 Transparent bridge.
1.62 0.01.08 Introduces MAC proxy.
1.60 0.01.
1.7 0.01.09
1.8 0.01.11 Robustness fix: Watchdog to fix the problem of wireless disassociation
due to RF interference.
1.9 Robustness fix: DHCP TimeOut option added.
With DHCP timeout is disabled, it always retries by sending out DHCP
discovery packet until it obtains IP address to itself or PC connected
behind it. This will make sure that any request received at the bridge
(BootP header) will return with a valid IP address to the requested client.
If the device or clients are not running with DHCP then this feature is
not valid.
1.11 Bug fix: delete older IP entry procedure.
Null packets implementation after 30 second of inactivity.
1.12 Bug fix: Ethernet lockup.
Users behind airBridge will be able to pass traffic to Internet
without any lockup, but unable to manage it from NOC after certain period of operation. So this is a known issue with 0.01.12 beta version.
1.14 0.01.14 Watchdog timer to reset radio under certain conditions.
Pin Cat5 Wire Colour PoE Functions 1. Orange w/stripe 2. Orange 3. Green w/stripe 4. Blue Remote reset (short to ground for reset) 5. Blue w/stripe Ground 6. Green 7. Brown w/stripe Vcc + 12 volts DC 8. Brown
Parameter Use Default? WISP Value
Firmware - 1.0.8
Bridge Name - refer to client database
IP Address/mask - 10.0.0.xx/8
Reg. domain N ETSI
Fragmentation Y 2346
RTS Threshold Y 2347
Authentication N Open (where no WEP)
Shared (when WEP used)
Rx/Tx Antenna Y Ant-A
Primary Port Y Wireless
Config Port Y Wireless & Ethernet
Rates Y 11Mbps*
Auto-fallback Y Enabled
ESSID, BSSID - AP ESSID // zero BSSID
Roaming N Enabled
Preamble Y Long
WEP Y/N Enabled as per AP config
Community p/w - as per client database
Notes:
The exact figures for acceptance of a radio link are dependent upon the equipment used. Hence, these guidelines are quite specific to their respective hardware and for other situations, new guidelines may need to be developed.
dBm Acceptance Criteria
-10 to -30 Accept
-31 to -45 Quick check for degradation potential before acceptance
-46 to -60 Rigorous degradation assessment needed, especially at -55dBm or worse.
Experience suggests that fixed obstructions (buildings) presenting a
fixed loss permit installs at low RSSI, but foliage can introduce huge
variable losses (leaves, water, wind sway) and require conservative judgement.
-60 to -70 Reject unless extenuating circumstances.
Non-guaranteed install: warn customer.
-71 or worse Reject
LQ% Acceptance Criteria >70% Accept 50%–69% Marginal: seek to improve <50% Reject
Since LQ is effectively a measure of interference, consistently low values on an otherwise good link hint at other problems and must be investigated.
SNR Acceptance Criteria >15 Accept 10–15 Accept, but check for potential to degrade 6–10 Marginal, but acceptable if stable and unlikely to degrade 0–5 Poor link which needs improvement.
Note: the Avaya sometimes reports spurious, high, positive values when the SNR is around zero. Usually, refreshing the page will replace this with the correct value although if this is the best signal level, the link is unviable.
All management is done through SNMP (SimpleMonitor is just an SNMP front-end) and the public and private community keys correspond to the Public and Administrator passwords.
Note that the SimpleMonitor Search function issues a broadcast SNMP query, which causes some network elements to complain via the logs:
Sep 27 13:21:45 localhost snmptrapd[3250]: 10.0.0.14: Enterprise Specific Trap (3) Uptime: 5 days, 12:25:39.23, SNMPv2-SMI::enterprises.11898.2.1.18.3.3 = IpAddress: 10.0.0.244 Sep 27 13:21:45 localhost snmptrapd[3250]: 10.0.0.13 [10.0.0.13]: Trap SNMPv2-MIB::sysUpTime = Timeticks: (67381568) 7 days, 19:10:15.68, SNMPv2-MIB::snmpTrapOID = OID: SNMPv2-SMI::enterprises.11898.2.1.18.3.3, SNMPv2-SMI::enterprises.11898.2.1.18.3.3 = IpAddress: 10.0.0.244, SNMPv2-MIB::snmpTrapEnterprise = OID: SNMPv2-SMI::enterprises.11898.2.1 Sep 27 13:21:45 localhost snmptrapd[3250]: 10.0.0.11: Enterprise Specific Trap (3) Uptime: 1 day, 9:17:16.36, SNMPv2-SMI::enterprises.11898.2.1.18.3.3 = IpAddress: 10.0.0.244 Sep 27 13:21:45 localhost snmptrapd[3250]: 10.0.0.12: Enterprise Specific Trap (3) Uptime: 7 days, 22:37:56.52, SNMPv2-SMI::enterprises.11898.2.1.18.3.3 = IpAddress: 10.0.0.244 Sep 27 13:21:45 localhost snmptrapd[3250]: 10.0.0.10: Enterprise Specific Trap (3) Uptime: 2:00:12.14, SNMPv2-SMI::enterprises.11898.2.1.18.3.3 = IpAddress: 10.0.0.244
Atmel Wireless MIB: Wbridge.MIB
Data MIB Defn OID Reboot flag sysReset enterprises.410.1.1.1.2 (set to 1) SNMP Trap Enable - enterprises.410.1.1.1.3 (1=enable, 2=disable) Factory reset sysLoadDefaults enterprises.410.1.1.1.4 RF channel OperChannelID enterprises.410.1.2.1.1.0 Ethernet Rcv stats EthRxStatistics enterprises.410.1.1.7.1 Ethernet Xmit stats EthTxStatistics enterprises.410.1.1.7.2 ESSID operESSID enterprises.410.1.2.1.3 Rf stats wirelessStatistics enterprises.410.1.2.3.1.0
Examples:
$ snmpget -v 1 -c ******** 10.0.0.50 enterprises.410.1.2.3.1.0 SNMPv2-SMI::enterprises.410.1.2.3.1.0 = Hex-STRING: 0A 47 01 00 00 00 00 00 00 00 00 00 00 00 00 00 81 94 01 00 00 00 00 00 00 00 00 00 A2 8C 01 00 A7 7E 00 00 AD B6 00 00 81 CB 09 00 ED 46 01 00 00 00 00 00 00 00 00 00 8B 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 18 00 00 00 05 00 00 00 16 3C 02 00 53 05 00 00 $ snmpset -v 1 -c ******** 10.0.0.50 1.3.6.1.4.1.410.1.1.1.2.0 i 1 SNMPv2-SMI::enterprises.410.1.1.1.2.0 = INTEGER: 1 %
# Description Variables 1 Wireless Bridge started a new BSS trapBSSID 2 A new STAtion detected in the IBSS operEthernetAddress 3 Reserved Trap 4 Wireless Bridge received a Disassociation frame 5 Reserved Trap 6 Unit resets sysReset 7 Unit IP address is set OperIPAddress 8 Unit Starts Up 9 Unit failed to Erase Flash 10 Unit is associated to the following BSS trapBSSID 11 Unit Roamed. Scanning for a new BSS 12 Multiple attached STAtions in the Ethernet side trapBSSID 13 Unit scanning after failing to authenticate trapBSSID 14 Unit scanning after failing to associate trapBSSID
Example:
Jul 16 16:24:38 localhost snmptrapd[20840]: 10.0.0.57: Enterprise Specific Trap (11) Uptime: 2 days
#!/bin/sh
# Quick script to send an SMNP message to a SmartBridges AirBridge device.
# Device's host IP address must be given but default community
# password is encoded in the script and hence is optional.
#
# Nigel Bruin 2004
if [ $# -eq 0 ];
then
echo 'Usage: '$0' host-IP-address community-password'
exit 1
else
if [ $# -eq 1 ];
then
CPW='public'
else
CPW=$2
fi
/usr/bin/snmpset -v 1 -c $CPW $1 1.3.6.1.4.1.410.1.1.1.2.0 i 1 > /dev/null
if [ $? -eq 0 ];
then
echo 'Reboot message sent to '$1'. AB reboot should take about 3 seconds.'
else
echo 'ERROR: Problem reboot the ABT.'
exit 1
fi
fi
• Trango systems
• Trango Downloads
• Trango MRTG reference
The TranoLINK-10 supports http: and telnet. Unit password is used for all management connections. Default IP address is 192.168.100.100, password trango.
The TrangoLINK is capable of 4W EIRP (36dBm), which is above the OfCOM 5.8GHz ISM band limit of 2W (+33dBm). The Trango radio must be powered down to +19dBm which together with the +14dB antenna gives the maximum permitted +33dB EIRP.
The TrangoLINK-10 radios are defined as Master and Remote and are labelled at MU and RU. They have different firmware loads.
When logged into the Master, some commands can be executed on the Remote by prefixing the command with ru (meaning remote unit), for example: ru sysinfo
To configure a TrangoLINK-10 from factory defaults:
#> password New password (4 to 15 characters and no space):Please confirm again: Update flash successful. Done. #> logout Connection closed by foreign host. $ telnet 10.0.0.6 Trying 10.0.0.6... Connected to 10.0.0.6. Escape character is '^]'. Welcome to Trango Broadband Wireless P5830S Master 1p04H8100D04032401 Password: #>
[nagios@localhost nagios]$ telnet 10.0.0.6 Trying 10.0.0.6... Connected to 10.0.0.6 (10.0.0.6). Escape character is '^]'. Welcome to Trango Broadband Wireless P5830S Master 1p04H8100D04032401 Password:#> tftpd on [Tftpd] listen [File Name] N/A [File Length] N/A [File Checksum] N/A Success.
[nagios@localhost nagios]$ tftp 10.0.0.6 tftp> binary tftp> put mu_1p1H8100D04082301.s19 Sent 651774 bytes in 1.0 seconds tftp> quit [nagios@localhost nagios]$
#> tftpd [Tftpd] listen [File Name] MU_1P1H8100D04082301.S19 [File Length] 675056 bytes [File Checksum] F8 #> ver [Hardware Version] 8100 [FPGA Version] 02103000 [Checksum] 7ADD5AB6 [Firmware Version] M 1p04H8100D04032401 [Checksum] 8EFE75C1 #> save mainimage 8EFE75C1 3C61CD5C tftp file size 651774 bytes. Download S-Rec File ... ............................................................ ........................................................ Done. Erase Flash Memory ... Done. Write S-REC Image into Flash Memory ... ............................................................ ........................................................ 349148 bytes Done. Success. [Checksum] 3C61CD5C Success.
http://www.zoom.com/
http://www.zoom.com/techsupport/adsl/adsl_5560.shtml
The modem supports http and telnet (limited to a single concurrent connection).
Unit password is used for all management connections. Default IP address is 10.0.0.2, password zoomadsl. To restore to factory default: power cycle then press & hold reset button for >5S.
A successful link negotiation will show a progression through the following states, as shown in the ADSL Status output:
Activation -> Channel Analysis -> Exchange -> Showtime
When reset to factory defaults (NAT enabled), the modem has a serious security vulnerability where Internet-side ports are open to login, permitting remote status query and factory reset by any Internet user:
Port Service 23/tcp telnet 80/tcp http 254/tcp telnet 255/tcp telnet
The default modem password (zoomadsl) is sufficient to gain access to the menus. Zoom recommend the following procedure to secure the modem:
• Remove any Virtual Server port entries, save changes, reboot.
• Enable the DMZ and specify a bogus IP address, save changes, and reboot.
If you want specific ports open (80-HTTP, 3389-Remote Desktop, etc) then you must add those ports to the Virtual Server. After adding your ports and directing them to your local computer hosting the service, save the changes and reboot.
MRTG setup for WISP network elements.
All examples use "public" as placeholder for corresponding SMNP community string.
# RRD data archiver #55 23 * * * /usr/local/bin/rrd-archive.pl >/dev/null 2>&1 # MRTG data collection routines */5 * * * * /usr/bin/perl /usr/local/mrtg-2/bin/mrtg /Library/WebServer/mrtg/cfg/wisp.cfg --logging /var/log/mrtg.log >/dev/null 2>&1
############################################################################### # System: NMS # Description: WISP Broadband MRTG master config file # Contact: Nigel Bruin # Location: ############################################################################### ############################################################################### # # Global Defaults # HtmlDir: /Library/WebServer/mrtg/logs ImageDir: /Library/WebServer/mrtg/images IconDir: /mrtg/images/ LogDir: /Library/WebServer/mrtg/logs LogFormat: rrdtool RRDRowCount[_]: 5000 PathAdd: /usr/local/rrdtool-1.2.12/bin/ ConversionCode: /usr/local/mrtg-2/bin/MyConversions.pl #timeout => $default_timeout, #retries => $default_retries, #backoff => $default_backoff, #default_max_repetitions => $max_repetitions, #use_16bit_request_ids => 1, #lenient_source_port_matching => 0, #lenient_source_address_matching => 1 SnmpOptions: timeout => 2, retries => 1 Options[_]: bits, growright Kilo[_]: 1024 XSize[_]: 600 NoMib2: Yes #SingleRequest: Yes Include: Cisco.cfg Include: Cyclone.cfg Include: Baystack.cfg Include: Gemini.cfg Include: Trango.cfg Include: WRN1WRM2.cfg Include: AP-WRN1.cfg Include: AP-WRN2.cfg Include: AP-WRM1.cfg Include: AP-WRM2.cfg Include: AP-ICK1.cfg Include: AP-ICK2.cfg Include: NMS.cfg Include: UPS1.cfg Include: UPS2.cfg Include: UPS3.cfg Include: UPS4.cfg Include: UPS5.cfg Include: SB.cfg # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#########################################################################
#
# WISP mrtg SNMP conversions routines
#
# Nigel Bruin, 2006
#
#########################################################################
#
# Convert APC UPS RunTime (Timeticks) to INTEGER in minutes
#
# Input string is of the form "1:02:00.00" or "1:02:00"
# i.e. hh:mm:ss.nn
#
sub Runtime2Int {
my $value = shift;
if (defined($value))
{
$value =~ s/(\d*):(\d*):\d*.\d*/int(($1 * 60)+$2)/e;
$value =~ s/(\d*):(\d*):\d*/int(($1 * 60)+$2)/e;
};
return $value;
}
#########################################################################
#
# Scale Trango RSSI (add 100)
#
# Trango returns powers as negative dBm in teh range -99 to -40 or so.
# Add 100 to shift scale into the positive.
#
sub TrangoScaleRSSI {
my $value = shift;
if (defined($value)) { $value += 100 };
return $value;
}
#########################################################################
#
# Scale APC UPS voltage (subtract 180)
#
sub APCscaleVolts {
my $value = shift;
if (defined($value)) { $value -= 180 };
return $value;
}
#########################################################################
#
# Scale APC UPS frequency (subtract 45)
#
sub APCscaleHertz {
my $value = shift;
if (defined($value)) { $value -= 45 };
return $value;
}
#########################################################################
#
# Scale APC UPS Output load (percentage -> Watts) for 1000kVA rating
#
sub APCscaleLoad1000 {
my $value = shift;
if (defined($value)) { $value *= 10 };
return $value;
}
#########################################################################
#
# Scale APC UPS Output load (percentage -> Watts) for 1400kVA rating
#
sub APCscaleLoad1400 {
my $value = shift;
if (defined($value)) { $value *= 14 };
return $value;
}
#########################################################################
Setup is straight-forward, e.g. key changes in routers2.conf:
dbpath = /Library/WebServer/mrtg/logs graphpath = /Library/WebServer/mrtg/stats graphurl = /mrtg/stats confpath = /Library/WebServer/mrtg/cfg cfgfiles = *.cfg iconurl = /mrtg/rrdicons/ defaulttarget = interface graphstyle = big usebigk = no sorder = t n n2 l l2 x x2 archive = yes showfindbox = yes
############################################################################################ # # APC UPS # Directory[_]: Directory[_]: ups # ############################################################################################ # apc.products.hardware.ups.upsInput.upsAdvInput.upsAdvInputLineVoltage # apc.products.hardware.ups.upsOutput.upsAdvOutput.upsAdvOutputVoltage Target[UPS-InOutV]: .1.3.6.1.4.1.318.1.1.1.3.2.1.0&.1.3.6.1.4.1.318.1.1.1.4.2.1.0:public@10.0.0.42|APCscaleVolts Directory[UPS-InOutV]: ups Options[UPS-InOutV]: growright,gauge,nopercent Unscaled[UPS-InOutV]: ymwd MaxBytes[UPS-InOutV]: 100 Title[UPS-InOutV]: 180V - 280V YSize[UPS-InOutV]: 200 YTics[UPS-InOutV]: 10 ShortLegend[UPS-InOutV]: V YLegend[UPS-InOutV]: Input & Output: 180V - 280V LegendI[UPS-InOutV]: Input LegendO[UPS-InOutV]: Output PageTop[UPS-InOutV]: <H1>UPS: Input & Output Voltages (V)</H1> # apc.products.hardware.ups.upsBattery.upsAdvBattery.upsAdvBatteryCapacity Target[UPS-BCap]: .1.3.6.1.4.1.318.1.1.1.2.2.1.0&.1.3.6.1.4.1.318.1.1.1.2.2.1.0:public@10.0.0.42 Directory[UPS-BCap]: ups Options[UPS-BCap]: growright,gauge,nopercent Unscaled[UPS-BCap]: ymwd MaxBytes[UPS-BCap]: 100 Title[UPS-BCap]: Battery (%) ShortLegend[UPS-BCap]: % YLegend[UPS-BCap]: Battery (%) LegendI[UPS-BCap]: Charge LegendO[UPS-BCap]: PageTop[UPS-BCap]: <H1>UPS: Battery Capacity (%)</H1> # apc.products.hardware.ups.upsBattery.upsAdvBattery.upsAdvBatteryRunTimeRemaining Target[UPS-RTime]: .1.3.6.1.4.1.318.1.1.1.2.2.3.0&.1.3.6.1.4.1.318.1.1.1.2.2.3.0:public@10.0.0.42|Runtime2Int Directory[UPS-RTime]: ups Options[UPS-RTime]: growright,gauge,nopercent Unscaled[UPS-RTime]: ymwd MaxBytes[UPS-RTime]: 300 Title[UPS-RTime]: Runtime (mins) YSize[UPS-RTime]: 150 ShortLegend[UPS-RTime]: Mins YTics[UPS-RTime]: 4 YLegend[UPS-RTime]: Batt. Runtime (Mins) LegendI[UPS-RTime]: Runtime LegendO[UPS-RTime]: PageTop[UPS-RTime]: <H1>UPS: Predicted Battery Runtime (Mins): C2610, Cyclone, Gemini</H1> # apc.products.hardware.ups.upsBattery.upsAdvBattery.upsAdvBatteryTemperature Target[UPS-BTemp]: .1.3.6.1.4.1.318.1.1.1.2.2.2.0&.1.3.6.1.4.1.318.1.1.1.2.2.2.0:public@10.0.0.42 Directory[UPS-BTemp]: ups Options[UPS-BTemp]: growright,gauge,nopercent Unscaled[UPS-BTemp]: ymwd MaxBytes[UPS-BTemp]: 50 AbsMax[UPS-BTemp]: 100 Title[UPS-BTemp]: TempM(deg C) ShortLegend[UPS-BTemp]: Deg C WithPeak[UPS-BTemp]: ymwd YTics[UPS-BTemp]: 5 YLegend[UPS-BTemp]: Temp (deg C) LegendI[UPS-BTemp]: Battery Temp LegendO[UPS-BTemp]: PageTop[UPS-BTemp]: <H1>UPS: Battery Temperature (Deg C)</H1> # apc.products.hardware.ups.upsConfig.upsAdvConfig.upsAdvConfigLowTransferVolt # apc.products.hardware.ups.upsInput.upsAdvInput.upsAdvInputLineVoltage Target[UPS-InputV]: .1.3.6.1.4.1.318.1.1.1.5.2.3.0&.1.3.6.1.4.1.318.1.1.1.3.2.1.0:public@10.0.0.42|APCscaleVolts Directory[UPS-InputV]: ups Options[UPS-InputV]: growright,gauge,nopercent Unscaled[UPS-InputV]: ymwd MaxBytes[UPS-InputV]: 100 Title[UPS-InputV]: 180V - 280V ShortLegend[UPS-InputV]: Volts YLegend[UPS-InputV]: 180V - 280V LegendI[UPS-InputV]: Treshold LegendO[UPS-InputV]: Input PageTop[UPS-InputV]: <H1>UPS: Mains Input Voltage & Threshold (V)</H1> # apc.products.hardware.ups.upsInput.upsAdvInput.upsAdvInputMinLineVoltage # apc.products.hardware.ups.upsInput.upsAdvInput.upsAdvInputMaxLineVoltage Target[UPS-InputMMV]: .1.3.6.1.4.1.318.1.1.1.3.2.3.0&.1.3.6.1.4.1.318.1.1.1.3.2.2.0:public@10.0.0.42|APCscaleVolts Directory[UPS-InputMMV]: ups Options[UPS-InputMMV]: growright,gauge,nopercent Unscaled[UPS-InputMMV]: ymwd MaxBytes[UPS-InputMMV]: 100 Title[UPS-InputMMV]: 180V - 280V YSize[UPS-InputMMV]: 200 YTics[UPS-InputMMV]: 10 ShortLegend[UPS-InputMMV]: Volts YLegend[UPS-InputMMV]: MIn & Max: 180V - 280V LegendI[UPS-InputMMV]: Min Input LegendO[UPS-InputMMV]: Max Input PageTop[UPS-InputMMV]: <H1>UPS: Mains Input Min & Max Voltage (V)</H1> # apc.products.hardware.ups.upsInput.upsAdvInput.upsAdvInputFrequency Target[UPS-InputHz]: .1.3.6.1.4.1.318.1.1.1.3.2.4.0&.1.3.6.1.4.1.318.1.1.1.3.2.4.0:public@10.0.0.42|APCscaleHertz Directory[UPS-InputHz]: ups Options[UPS-InputHz]: growright,gauge,nopercent Unscaled[UPS-InputHz]: ymwd MaxBytes[UPS-InputHz]: 10 Title[UPS-InputHz]: 45Hz - 55Hz ShortLegend[UPS-InputHz]: Hertz YTics[UPS-InputHz]: 10 YLegend[UPS-InputHz]: 45Hz - 55Hz LegendI[UPS-InputHz]: Input Freq LegendO[UPS-InputHz]: PageTop[UPS-InputHz]: <H1>UPS: Mains Input Freq (Hz)</H1> # apc.products.hardware.ups.upsConfig.upsAdvConfig.upsAdvConfigRatedOutputVoltage # apc.products.hardware.ups.upsOutput.upsAdvOutput.upsAdvOutputVoltage Target[UPS-OutputV]: .1.3.6.1.4.1.318.1.1.1.5.2.1.0&.1.3.6.1.4.1.318.1.1.1.4.2.1.0:public@10.0.0.42|APCscaleVolts Directory[UPS-OutputV]: ups Options[UPS-OutputV]: growright,gauge,nopercent Unscaled[UPS-OutputV]: ymwd MaxBytes[UPS-OutputV]: 100 Title[UPS-OutputV]: 180V - 280V ShortLegend[UPS-OutputV]: Volts YLegend[UPS-OutputV]: 180V - 280V LegendI[UPS-OutputV]: Rating LegendO[UPS-OutputV]: Output PageTop[UPS-OutputV]: <H1>UPS: Rated & Actual Output Voltage (V)</H1> # apc.products.hardware.ups.upsOutput.upsAdvOutput.upsAdvOutputLoad # Expressed as percentage of unit capacity. Assume 1KVA unit hence x10 for watts. Target[UPS-OutputW]: .1.3.6.1.4.1.318.1.1.1.4.2.3.0&.1.3.6.1.4.1.318.1.1.1.4.2.3.0:public@10.0.0.42|APCscaleLoad1000 Directory[UPS-OutputW]: ups Options[UPS-OutputW]: growright,gauge,nopercent Unscaled[UPS-OutputW]: ymwd MaxBytes[UPS-OutputW]: 1000 WithPeak[UPS-OutputW]: ymwd Title[UPS-OutputW]: Watts YSize[UPS-OutputW]: 200 ShortLegend[UPS-OutputW]: Watts YTics[UPS-OutputW]: 10 YLegend[UPS-OutputW]: Load (Watts) LegendI[UPS-OutputW]: Load LegendO[UPS-OutputW]: PageTop[UPS-OutputW]: <H1>UPS: Output Load (W)</H1> ############################################################################################
############################################################################### # # Avaya Access Point # Directory[_]: Directory[_]: ap # ############################################################################### Target[AP-Eth]: ifInOctets.1&ifOutOctets.1:public@10.0.0.13 Options[AP-Eth]: growright, noinfo, nopercent Title[AP-Eth]: Traffic Analysis (Ethernet) MaxBytes[AP-Eth]: 1600000 XSize[AP-Eth]: 600 YLegend[AP-Eth]: Bytes (in, out) PageTop[AP-Eth]: <H1>Traffic: AP-Ethernet</H1> Target[AP-WireA]: ifInOctets.3&ifOutOctets.3:public@10.0.0.13 Options[AP-WireA]: growright, noinfo, nopercent Title[AP-WireA]: Traffic Analysis (Wireless-A) MaxBytes[AP-WireA]: 1600000 XSize[AP-WireA]: 600 YLegend[AP-WireA]: Bytes (in, out) PageTop[AP-WireA]: <H1>Traffic: AP-Wireless-A</H1> Target[AP-WireB]: ifInOctets.4&ifOutOctets.4:public@10.0.0.13 Options[AP-WireB]: growright, noinfo, nopercent Title[AP-WireB]: Traffic Analysis (Wireless-B) MaxBytes[AP-WireB]: 1600000 XSize[AP-WireB]: 600 YLegend[AP-WireB]: Bytes (in, out) PageTop[AP-WireB]: <H1>Traffic: AP-Wireless-B</H1> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
############################################################################### # # BayStack Intelligent 24port Ethernet Switch # Directory[_]: Directory[_]: baystack # ############################################################################### Target[Baystack-P1]: ifInOctets.1&ifOutOctets.1:public@10.0.0.3 Title[Baystack-P1]: Traffic: Baystack Port 1 MaxBytes[Baystack-P1]: 16000000 XSize[Baystack-P1]: 600 YLegend[Baystack-P1]: Bytes (in, out) PageTop[Baystack-P1]: <H1>Traffic: Baystack Port 1</H1> Target[Baystack-P2]: ifInOctets.2&ifOutOctets.2:public@10.0.0.3 Title[Baystack-P2]: Traffic: Baystack Port 2 MaxBytes[Baystack-P2]: 16000000 XSize[Baystack-P2]: 600 YLegend[Baystack-P2]: Bytes (in, out) PageTop[Baystack-P2]: <H1>Traffic: Baystack Port 2</H1> Target[Baystack-P3]: ifInOctets.3&ifOutOctets.3:public@10.0.0.3 Title[Baystack-P3]: Traffic: Baystack Port 3 MaxBytes[Baystack-P3]: 16000000 XSize[Baystack-P3]: 600 YLegend[Baystack-P3]: Bytes (in, out) PageTop[Baystack-P3]: <H1>Traffic: Baystack Port 3</H1> Target[Baystack-P4]: ifInOctets.4&ifOutOctets.4:public@10.0.0.3 Title[Baystack-P4]: Traffic: Baystack Port 4 MaxBytes[Baystack-P4]: 16000000 XSize[Baystack-P4]: 600 YLegend[Baystack-P4]: Bytes (in, out) PageTop[Baystack-P4]: <H1>Traffic: Baystack Port 4</H1> Target[Baystack-P5]: ifInOctets.5&ifOutOctets.5:public@10.0.0.3 Title[Baystack-P5]: Traffic: Baystack Port 5 MaxBytes[Baystack-P5]: 16000000 XSize[Baystack-P5]: 600 YLegend[Baystack-P5]: Bytes (in, out) PageTop[Baystack-P5]: <H1>Traffic: Baystack Port 5</H1> Target[Baystack-P6]: ifInOctets.6&ifOutOctets.6:public@10.0.0.3 Title[Baystack-P6]: Traffic: Baystack Port 6 MaxBytes[Baystack-P6]: 16000000 XSize[Baystack-P6]: 600 YLegend[Baystack-P6]: Bytes (in, out) PageTop[Baystack-P6]: <H1>Traffic: Baystack Port 6</H1> Target[Baystack-P7]: ifInOctets.7&ifOutOctets.7:public@10.0.0.3 Title[Baystack-P7]: Traffic: Baystack Port 7 MaxBytes[Baystack-P7]: 16000000 XSize[Baystack-P7]: 600 YLegend[Baystack-P7]: Bytes (in, out) PageTop[Baystack-P7]: <H1>Traffic: Baystack Port 7</H1> Target[Baystack-P8]: ifInOctets.8&ifOutOctets.8:public@10.0.0.3 Title[Baystack-P8]: Traffic: Baystack Port 8 MaxBytes[Baystack-P8]: 16000000 XSize[Baystack-P8]: 600 YLegend[Baystack-P8]: Bytes (in, out) PageTop[Baystack-P8]: <H1>Traffic: Baystack Port 8</H1> Target[Baystack-P9]: ifInOctets.9&ifOutOctets.9:public@10.0.0.3 Title[Baystack-P9]: Traffic: Baystack Port 9 MaxBytes[Baystack-P9]: 16000000 XSize[Baystack-P9]: 600 YLegend[Baystack-P9]: Bytes (in, out) PageTop[Baystack-P9]: <H1>Traffic: Baystack Port 9</H1> Target[Baystack-P10]: ifInOctets.10&ifOutOctets.10:public@10.0.0.3 Title[Baystack-P10]: Traffic: Baystack Port 10 MaxBytes[Baystack-P10]: 16000000 XSize[Baystack-P10]: 600 YLegend[Baystack-P10]: Bytes (in, out) PageTop[Baystack-P10]: <H1>Traffic: Baystack Port 10</H1> Target[Baystack-P11]: ifInOctets.11&ifOutOctets.11:public@10.0.0.3 Title[Baystack-P11]: Traffic: Baystack Port 11 MaxBytes[Baystack-P11]: 16000000 XSize[Baystack-P11]: 600 YLegend[Baystack-P11]: Bytes (in, out) PageTop[Baystack-P11]: <H1>Traffic: Baystack Port 11</H1> Target[Baystack-P12]: ifInOctets.12&ifOutOctets.12:public@10.0.0.3 Title[Baystack-P12]: Traffic: Baystack Port 12 MaxBytes[Baystack-P12]: 16000000 XSize[Baystack-P12]: 600 YLegend[Baystack-P12]: Bytes (in, out) PageTop[Baystack-P12]: <H1>Traffic: Baystack Port 12</H1> Target[Baystack-P13]: ifInOctets.13&ifOutOctets.13:public@10.0.0.3 Title[Baystack-P13]: Traffic: Baystack Port 13 MaxBytes[Baystack-P13]: 16000000 XSize[Baystack-P13]: 600 YLegend[Baystack-P13]: Bytes (in, out) PageTop[Baystack-P13]: <H1>Traffic: Baystack Port 13</H1> Target[Baystack-P14]: ifInOctets.14&ifOutOctets.14:public@10.0.0.3 Title[Baystack-P14]: Traffic: Baystack Port 14 MaxBytes[Baystack-P14]: 16000000 XSize[Baystack-P14]: 600 YLegend[Baystack-P14]: Bytes (in, out) PageTop[Baystack-P14]: <H1>Traffic: Baystack Port 14</H1> Target[Baystack-P15]: ifInOctets.15&ifOutOctets.15:public@10.0.0.3 Title[Baystack-P15]: Traffic: Baystack Port 15 MaxBytes[Baystack-P15]: 16000000 XSize[Baystack-P15]: 600 YLegend[Baystack-P15]: Bytes (in, out) PageTop[Baystack-P15]: <H1>Traffic: Baystack Port 15</H1> Target[Baystack-P16]: ifInOctets.16&ifOutOctets.16:public@10.0.0.3 Title[Baystack-P16]: Traffic: Baystack Port 16 MaxBytes[Baystack-P16]: 16000000 XSize[Baystack-P16]: 600 YLegend[Baystack-P16]: Bytes (in, out) PageTop[Baystack-P16]: <H1>Traffic: Baystack Port 16</H1> Target[Baystack-P17]: ifInOctets.17&ifOutOctets.17:public@10.0.0.3 Title[Baystack-P17]: Traffic: Baystack Port 17 MaxBytes[Baystack-P17]: 16000000 XSize[Baystack-P17]: 600 YLegend[Baystack-P17]: Bytes (in, out) PageTop[Baystack-P17]: <H1>Traffic: Baystack Port 17</H1> Target[Baystack-P18]: ifInOctets.18&ifOutOctets.18:public@10.0.0.3 Title[Baystack-P18]: Traffic: Baystack Port 18 MaxBytes[Baystack-P18]: 16000000 XSize[Baystack-P18]: 600 YLegend[Baystack-P18]: Bytes (in, out) PageTop[Baystack-P18]: <H1>Traffic: Baystack Port 18</H1> Target[Baystack-P19]: ifInOctets.19&ifOutOctets.19:public@10.0.0.3 Title[Baystack-P19]: Traffic: Baystack Port 19 MaxBytes[Baystack-P19]: 16000000 XSize[Baystack-P19]: 600 YLegend[Baystack-P19]: Bytes (in, out) PageTop[Baystack-P19]: <H1>Traffic: Baystack Port 19</H1> Target[Baystack-P20]: ifInOctets.20&ifOutOctets.20:public@10.0.0.3 Title[Baystack-P20]: Traffic: Baystack Port 20 MaxBytes[Baystack-P20]: 16000000 XSize[Baystack-P20]: 600 YLegend[Baystack-P20]: Bytes (in, out) PageTop[Baystack-P20]: <H1>Traffic: Baystack Port 20</H1> Target[Baystack-P21]: ifInOctets.21&ifOutOctets.21:public@10.0.0.3 Title[Baystack-P21]: Traffic: Baystack Port 21 MaxBytes[Baystack-P21]: 16000000 XSize[Baystack-P21]: 600 YLegend[Baystack-P21]: Bytes (in, out) PageTop[Baystack-P21]: <H1>Traffic: Baystack Port 21</H1> Target[Baystack-P22]: ifInOctets.22&ifOutOctets.22:public@10.0.0.3 Title[Baystack-P22]: Traffic: Baystack Port 22 MaxBytes[Baystack-P22]: 16000000 XSize[Baystack-P22]: 600 YLegend[Baystack-P22]: Bytes (in, out) PageTop[Baystack-P22]: <H1>Traffic: Baystack Port 22</H1> Target[Baystack-P23]: ifInOctets.23&ifOutOctets.23:public@10.0.0.3 Title[Baystack-P23]: Traffic: Baystack Port 23 MaxBytes[Baystack-P23]: 16000000 XSize[Baystack-P23]: 600 YLegend[Baystack-P23]: Bytes (in, out) PageTop[Baystack-P23]: <H1>Traffic: Baystack Port 23</H1> Target[Baystack-P24]: ifInOctets.24&ifOutOctets.24:public@10.0.0.3 Title[Baystack-P24]: Traffic: Baystack Port 24 MaxBytes[Baystack-P24]: 16000000 XSize[Baystack-P24]: 600 YLegend[Baystack-P24]: Bytes (in, out) PageTop[Baystack-P24]: <H1>Traffic: Baystack Port 24</H1>
MRTG setup for a Cisco 2610 modular router with 3 ADSL WIC cards.
Uses and SNMP and a custom perl script which accesses the data via the HTTP interface (requires WGET).
mrtg config file:
############################################################################### # # Cisco 2610 Modular Router # Directory[_]: Directory[_]: cisco # ############################################################################### # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ADSL Traffic # ATM 0/0, index 1 Target[C2610-ADSL1]: ifInOctets.1&ifOutOctets.1:public@84.12.108.98 Directory[C2610-ADSL1]: cisco Title[C2610-ADSL1]: Traffic: C2610 (ATM 0/0, ADSL-1) MaxBytes1[C2610-ADSL1]: 250000 MaxBytes2[C2610-ADSL1]: 30000 AbsMax[C2610-ADSL1]: 1000000 WithPeak[C2610-ADSL1]: ymwd XSize[C2610-ADSL1]: 600 YLegend[C2610-ADSL1]: Bytes (in, out) PageTop[C2610-ADSL1]: <H1>Traffic: C2610 Modular Router (ATM 0/0, ADSL-1)</H1> # ATM 0/1, index 3 Target[C2610-ADSL2]: ifInOctets.3&ifOutOctets.3:public@84.12.108.98 Directory[C2610-ADSL2]: cisco Title[C2610-ADSL2]: Traffic: C2610 (ATM 0/1, ADSL-2) MaxBytes1[C2610-ADSL2]: 250000 MaxBytes2[C2610-ADSL2]: 30000 AbsMax[C2610-ADSL2]: 1000000 WithPeak[C2610-ADSL2]: ymwd XSize[C2610-ADSL2]: 600 YLegend[C2610-ADSL2]: Bytes (in, out) PageTop[C2610-ADSL2]: <H1>Traffic: C2610 Modular Router (ATM 0/1, ADSL-2)</H1> # ATM 1/0, index 4 Target[C2610-ADSL3]: ifInOctets.4&ifOutOctets.4:public@84.12.108.98 Directory[C2610-ADSL3]: cisco Title[C2610-ADSL3]: Traffic: C2610 (ATM 1/0, ADSL-3) MaxBytes1[C2610-ADSL3]: 250000 MaxBytes2[C2610-ADSL3]: 30000 AbsMax[C2610-ADSL3]: 1000000 WithPeak[C2610-ADSL3]: ymwd XSize[C2610-ADSL3]: 600 YLegend[C2610-ADSL3]: Bytes (in, out) PageTop[C2610-ADSL3]: <H1>Traffic: C2610 Modular Router (ATM 1/0, ADSL-3)</H1> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ADSL Line Speeds # ATM 0/0 Target[C2610-speed1]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m speed -a 0 -b 0` Directory[C2610-speed1]: cisco Title[C2610-speed1]: Line Speed: C2610 (ATM 0/0, ADSL-1) Options[C2610-speed1]: gauge, growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-speed1]: 8192 AbsMax[C2610-speed1]: 10000 Unscaled[C2610-speed1]: ymwd WithPeak[C2610-speed1]: ymwd XSize[C2610-speed1]: 600 YLegend[C2610-speed1]: kbps (in, out) PageTop[C2610-speed1]: <H1>Line Speed: C2610 Modular Router (ATM 0/0, ADSL-1)</H1> # ATM 0/1 Target[C2610-speed2]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m speed -a 0 -b 1` Directory[C2610-speed2]: cisco Title[C2610-speed2]: Line Speed: C2610 (ATM 0/1, ADSL-2) Options[C2610-speed2]: gauge, growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-speed2]: 8192 AbsMax[C2610-speed2]: 10000 Unscaled[C2610-speed2]: ymwd WithPeak[C2610-speed2]: ymwd XSize[C2610-speed2]: 600 YLegend[C2610-speed2]: kbps (in, out) PageTop[C2610-speed2]: <H1>Line Speed: C2610 Modular Router (ATM 0/1, ADSL-2)</H1> # ATM 1/0 Target[C2610-speed3]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m speed -a 1 -b 0` Directory[C2610-speed3]: cisco Title[C2610-speed3]: Line Speed: C2610 (ATM 1/0, ADSL-3) Options[C2610-speed3]: gauge, growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-speed3]: 8192 AbsMax[C2610-speed3]: 10000 Unscaled[C2610-speed3]: ymwd WithPeak[C2610-speed3]: ymwd XSize[C2610-speed3]: 600 YLegend[C2610-speed3]: kbps (in, out) PageTop[C2610-speed3]: <H1>Line Speed: C2610 Modular Router (ATM 1/0, ADSL-3)</H1> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ADSL Capacity Used # ATM 0/0 Target[C2610-capacity1]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m capacity -a 0 -b 0` Directory[C2610-capacity1]: cisco Title[C2610-capacity1]: Capacity Used: C2610 (ATM 0/0, ADSL-1) Options[C2610-capacity1]: gauge, growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-capacity1]: 100 AbsMax[C2610-capacity1]: 100 Unscaled[C2610-capacity1]: ymwd WithPeak[C2610-capacity1]: ymwd XSize[C2610-capacity1]: 600 YLegend[C2610-capacity1]: % PageTop[C2610-capacity1]: <H1>Capacity Used: C2610 Modular Router (ATM 0/0, ADSL-1)</H1> # ATM 0/1 Target[C2610-capacity2]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m capacity -a 0 -b 1` Directory[C2610-capacity2]: cisco Title[C2610-capacity2]: Capacity Used: C2610 (ATM 0/1, ADSL-2) Options[C2610-capacity2]: gauge, growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-capacity2]: 100 AbsMax[C2610-capacity2]: 100 Unscaled[C2610-capacity2]: ymwd WithPeak[C2610-capacity2]: ymwd XSize[C2610-capacity2]: 600 YLegend[C2610-capacity2]: % PageTop[C2610-capacity2]: <H1>Capacity Used: C2610 Modular Router (ATM 0/1, ADSL-2)</H1> # ATM 1/0 Target[C2610-capacity3]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m capacity -a 1 -b 0` Directory[C2610-capacity3]: cisco Title[C2610-capacity3]: Capacity Used: C2610 (ATM 1/0, ADSL-3) Options[C2610-capacity3]: gauge, growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-capacity3]: 100 AbsMax[C2610-capacity3]: 100 Unscaled[C2610-capacity3]: ymwd WithPeak[C2610-capacity3]: ymwd XSize[C2610-capacity3]: 600 YLegend[C2610-capacity3]: % PageTop[C2610-capacity3]: <H1>Capacity Used: C2610 Modular Router (ATM 1/0, ADSL-3)</H1> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ADSL Activations # ATM 0/0 Target[C2610-starts1]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m starts -a 0 -b 0` Directory[C2610-starts1]: cisco Title[C2610-starts1]: Interface Starts: C2610 (ATM 0/0, ADSL-1) Options[C2610-starts1]: growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-starts1]: 1000 AbsMax[C2610-starts1]: 1000 #Unscaled[C2610-starts1]: ymwd WithPeak[C2610-starts1]: ymwd XSize[C2610-starts1]: 600 YLegend[C2610-starts1]: # PageTop[C2610-starts1]: <H1>Interface Starts: C2610 Modular Router (ATM 0/0, ADSL-1)</H1> # ATM 0/1 Target[C2610-starts2]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m starts -a 0 -b 1` Directory[C2610-starts2]: cisco Title[C2610-starts2]: Interface Starts: C2610 (ATM 0/1, ADSL-2) Options[C2610-starts2]: growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-starts2]: 1000 AbsMax[C2610-starts2]: 1000 #Unscaled[C2610-starts2]: ymwd WithPeak[C2610-starts2]: ymwd XSize[C2610-starts2]: 600 YLegend[C2610-starts2]: # PageTop[C2610-starts2]: <H1>Interface Starts: C2610 Modular Router (ATM 0/1, ADSL-2)</H1> # ATM 1/0 Target[C2610-starts3]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m starts -a 1 -b 0` Directory[C2610-starts3]: cisco Title[C2610-starts3]: Interface Starts: C2610 (ATM 1/0, ADSL-3) Options[C2610-starts3]: growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-starts3]: 1000 AbsMax[C2610-starts3]: 1000 #Unscaled[C2610-starts3]: ymwd WithPeak[C2610-starts3]: ymwd XSize[C2610-starts3]: 600 YLegend[C2610-starts3]: # PageTop[C2610-starts3]: <H1>Interface Starts: C2610 Modular Router (ATM 1/0, ADSL-3)</H1> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ADSL Reed-Solomon EC Rate # ATM 0/0 Target[C2610-ecg1]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m ec -a 0 -b 0` Directory[C2610-ecg1]: cisco Title[C2610-ecg1]: EC Rate: C2610 (ATM 0/0, ADSL-1) Options[C2610-ecg1]: growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-ecg1]: 100000 AbsMax[C2610-ecg1]: 100000 #Unscaled[C2610-ecg1]: ymwd WithPeak[C2610-ecg1]: ymwd XSize[C2610-ecg1]: 600 YLegend[C2610-ecg1]: EC Rate PageTop[C2610-ecg1]: <H1>EC Rate: C2610 Modular Router (ATM 0/0, ADSL-1)</H1> # ATM 0/1 Target[C2610-ecg2]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m ec -a 0 -b 1` Directory[C2610-ecg2]: cisco Title[C2610-ecg2]: EC rate: C2610 (ATM 0/1, ADSL-2) Options[C2610-ecg2]: growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-ecg2]: 100000 AbsMax[C2610-ecg2]: 100000 #Unscaled[C2610-ecg2]: ymwd WithPeak[C2610-ecg2]: ymwd XSize[C2610-ecg2]: 600 YLegend[C2610-ecg2]: EC Rate PageTop[C2610-ecg2]: <H1>EC Rate: C2610 Modular Router (ATM 0/1, ADSL-2)</H1> # ATM 1/0 Target[C2610-ecg3]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m ec -a 1 -b 0` Directory[C2610-ecg3]: cisco Title[C2610-ecg3]: EC Rate: C2610 (ATM 1/0, ADSL-3) Options[C2610-ecg3]: growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-ecg3]: 100000 AbsMax[C2610-ecg3]: 100000 #Unscaled[C2610-ecg3]: ymwd WithPeak[C2610-ecg3]: ymwd XSize[C2610-ecg3]: 600 YLegend[C2610-ecg3]: EC Rate PageTop[C2610-ecg3]: <H1>EC Rate: C2610 Modular Router (ATM 1/0, ADSL-3)</H1> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ADSL Reed-Solomon EC Counters # ATM 0/0 Target[C2610-ecc1]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m ec -a 0 -b 0` Directory[C2610-ecc1]: cisco Title[C2610-ecc1]: EC Counter: C2610 (ATM 0/0, ADSL-1) Options[C2610-ecc1]: gauge, growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-ecc1]: 1000000 AbsMax[C2610-ecc1]: 100000000 #Unscaled[C2610-ecc1]: ymwd WithPeak[C2610-ecc1]: ymwd XSize[C2610-ecc1]: 600 YLegend[C2610-ecc1]: Error Counter PageTop[C2610-ecc1]: <H1>EC Counter: C2610 Modular Router (ATM 0/0, ADSL-1)</H1> # ATM 0/1 Target[C2610-ecc2]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m ec -a 0 -b 1` Directory[C2610-ecc2]: cisco Title[C2610-ecc2]: EC Counter: C2610 (ATM 0/1, ADSL-2) Options[C2610-ecc2]: gauge, growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-ecc2]: 1000000 AbsMax[C2610-ecc2]: 100000000 #Unscaled[C2610-ecc2]: ymwd WithPeak[C2610-ecc2]: ymwd XSize[C2610-ecc2]: 600 YLegend[C2610-ecc2]: Error Counter PageTop[C2610-ecc2]: <H1>EC Counter: C2610 Modular Router (ATM 0/1, ADSL-2)</H1> # ATM 1/0 Target[C2610-ecc3]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m ec -a 1 -b 0` Directory[C2610-ecc3]: cisco Title[C2610-ecc3]: EC Counter: C2610 (ATM 1/0, ADSL-3) Options[C2610-ecc3]: gauge, growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-ecc3]: 1000000 AbsMax[C2610-ecc3]: 100000000 #Unscaled[C2610-ecc3]: ymwd WithPeak[C2610-ecc3]: ymwd XSize[C2610-ecc3]: 600 YLegend[C2610-ecc3]: Error Counter PageTop[C2610-ecc3]: <H1>EC Counter: C2610 Modular Router (ATM 1/0, ADSL-3)</H1> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ADSL CRC Errors # ATM 0/0 Target[C2610-crc1]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m crc -a 0 -b 0` Directory[C2610-crc1]: cisco Title[C2610-crc1]: CRC Errors: C2610 (ATM 0/0, ADSL-1) Options[C2610-crc1]: growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-crc1]: 1000 AbsMax[C2610-crc1]: 1000 #Unscaled[C2610-crc1]: ymwd WithPeak[C2610-crc1]: ymwd XSize[C2610-crc1]: 600 YLegend[C2610-crc1]: Error Count PageTop[C2610-crc1]: <H1>CRC Errors: C2610 Modular Router (ATM 0/0, ADSL-1)</H1> # ATM 0/1 Target[C2610-crc2]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m crc -a 0 -b 1` Directory[C2610-crc2]: cisco Title[C2610-crc2]: CRC Errors: C2610 (ATM 0/1, ADSL-2) Options[C2610-crc2]: growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-crc2]: 1000 AbsMax[C2610-crc2]: 1000 #Unscaled[C2610-crc2]: ymwd WithPeak[C2610-crc2]: ymwd XSize[C2610-crc2]: 600 YLegend[C2610-crc2]: Error Count PageTop[C2610-crc2]: <H1>CRC Errors: C2610 Modular Router (ATM 0/1, ADSL-2)</H1> # ATM 1/0 Target[C2610-crc3]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m crc -a 1 -b 0` Directory[C2610-crc3]: cisco Title[C2610-crc3]: CRC Errors: C2610 (ATM 1/0, ADSL-3) Options[C2610-crc3]: growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-crc3]: 1000 AbsMax[C2610-crc3]: 1000 #Unscaled[C2610-crc3]: ymwd WithPeak[C2610-crc3]: ymwd XSize[C2610-crc3]: 600 YLegend[C2610-crc3]: Error Count PageTop[C2610-crc3]: <H1>CRC Errors: C2610 Modular Router (ATM 1/0, ADSL-3)</H1> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ADSL Header Errors # ATM 0/0 Target[C2610-header1]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m header -a 0 -b 0` Directory[C2610-header1]: cisco Title[C2610-header1]: Header Errors: C2610 (ATM 0/0, ADSL-1) Options[C2610-header1]: growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-header1]: 1000 AbsMax[C2610-header1]: 1000 #Unscaled[C2610-header1]: ymwd WithPeak[C2610-header1]: ymwd XSize[C2610-header1]: 600 YLegend[C2610-header1]: Error Count PageTop[C2610-header1]: <H1>Header Errors: C2610 Modular Router (ATM 0/0, ADSL-1)</H1> # ATM 0/1 Target[C2610-header2]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m header -a 0 -b 1` Directory[C2610-header2]: cisco Title[C2610-header2]: Header Errors: C2610 (ATM 0/1, ADSL-2) Options[C2610-header2]: growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-header2]: 1000 AbsMax[C2610-header2]: 1000 #Unscaled[C2610-header2]: ymwd WithPeak[C2610-header2]: ymwd XSize[C2610-header2]: 600 YLegend[C2610-header2]: Error Count PageTop[C2610-header2]: <H1>Header Errors: C2610 Modular Router (ATM 0/1, ADSL-2)</H1> # ATM 1/0 Target[C2610-header3]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m header -a 1 -b 0` Directory[C2610-header3]: cisco Title[C2610-header3]: Header Errors: C2610 (ATM 1/0, ADSL-3) Options[C2610-header3]: growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-header3]: 1000 AbsMax[C2610-header3]: 1000 #Unscaled[C2610-header3]: ymwd WithPeak[C2610-header3]: ymwd XSize[C2610-header3]: 600 YLegend[C2610-header3]: Error Count PageTop[C2610-header3]: <H1>Header Errors: C2610 Modular Router (ATM 1/0, ADSL-3)</H1> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ADSL SNR # ATM 0/0 Target[C2610-snr1]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m snr -a 0 -b 0` Directory[C2610-snr1]: cisco Title[C2610-snr1]: SNR: C2610 (ATM 0/0, ADSL-1) Options[C2610-snr1]: gauge, growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-snr1]: 100 AbsMax[C2610-snr1]: 100 #Unscaled[C2610-snr1]: ymwd WithPeak[C2610-snr1]: ymwd XSize[C2610-snr1]: 600 YLegend[C2610-snr1]: SNR PageTop[C2610-snr1]: <H1>SNR: C2610 Modular Router (ATM 0/0, ADSL-1)</H1> # ATM 0/1 Target[C2610-snr2]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m snr -a 0 -b 1` Directory[C2610-snr2]: cisco Title[C2610-snr2]: SNR: C2610 (ATM 0/1, ADSL-2) Options[C2610-snr2]: gauge, growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-snr2]: 100 AbsMax[C2610-snr2]: 100 #Unscaled[C2610-snr2]: ymwd WithPeak[C2610-snr2]: ymwd XSize[C2610-snr2]: 600 YLegend[C2610-snr2]: SNR PageTop[C2610-snr2]: <H1>SNR: C2610 Modular Router (ATM 0/1, ADSL-2)</H1> # ATM 1/0 Target[C2610-snr3]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m snr -a 1 -b 0` Directory[C2610-snr3]: cisco Title[C2610-snr3]: SNR: C2610 (ATM 1/0, ADSL-3) Options[C2610-snr3]: gauge, growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-snr3]: 100 AbsMax[C2610-snr3]: 100 #Unscaled[C2610-snr3]: ymwd WithPeak[C2610-snr3]: ymwd XSize[C2610-snr3]: 600 YLegend[C2610-snr3]: SNR PageTop[C2610-snr3]: <H1>SNR: C2610 Modular Router (ATM 1/0, ADSL-3)</H1> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Ethernet Traffic Target[C2610-Eth]: ifInOctets.2&ifOutOctets.2:public@84.12.108.98 Directory[C2610-Eth]: cisco Title[C2610-Eth]: Traffic: C2610 Ethernet MaxBytes1[C2610-Eth]: 100000 MaxBytes2[C2610-Eth]: 1000000 AbsMax[C2610-Eth]: 4000000 #Unscaled[C2610-Eth]: ymwd WithPeak[C2610-Eth]: ymwd XSize[C2610-Eth]: 600 YSize[C2610-Eth]: 200 YLegend[C2610-Eth]: Bytes (in, out) PageTop[C2610-Eth]: <H1>Traffic: C2610 Modular Router - Ethernet</H1> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Perl code (/usr/bin/adsl-mrtg.pl):
#!/usr/bin/perl -w
use strict;
use Getopt::Long;
use Pod::Usage;
=head1 NAME
adsl-mrtg.pl - Cisco WIC-1 ADSL MRTG plug-in
=head1 SYNOPSIS
adsl-mrtg.pl -H host [-u user] [-p password] [-m measure] -a interfaceA -b interfaceB
host: IP address of the router
user: Web user (default admin)
password: Web password (default public)
measure: speed* | capacity | snr | ec | crc | header | attenuation | starts
interfaceA: Interface number A
interfaceB: Interface number B
e.g., to graph ATM0/1:
adsl-mrtg.pl -H 10.0.0.10 -p password -m traffic -a 0 -b 1
=head1 DESCRIPTION
Uses the web interface on a Cisco router to query the status of an ADSL
link on a WIC-1 card and return the specified parameter MRTG-compatible
format.
=head1 AUTHOR
Nigel Bruin 2006
=cut
###############################################################################
#
# Constants
# Path to WGET
my $PATHTOWGET = "/usr/bin/wget";
# Measure parameter values
my $measureSpeed = 'speed';
my $measureCapacity = 'capacity';
my $measureSNR = 'snr';
my $measureEC = 'ec';
my $measureCRC = 'crc';
my $measureHeader = 'header';
my $measureAtt = 'attentuation';
my $measureStarts = 'starts';
###############################################################################
#
# Global variables
my ( $host, $user, $password, $measure, $ifA, $ifB, $output );
###############################################################################
#
# Main routine
GetOptions("H=s" => \$host,
"u=s" => \$user,
"p=s" => \$password,
"m=s" => \$measure,
"a=s" => \$ifA,
"b=s" => \$ifB
);
# Enforce parameter defaults
if(!$user ) { $user = 'admin' };
if(!$password) { $password = 'public' };
if(!$measure ) { $measure = $measureSpeed };
if(!$ifA ) { $ifA = '0' };
if(!$ifB ) { $ifB = '0' };
# Command line options checking
if ( !$host )
{ pod2usage("Not enough arguments.\n"); exit 1 };
# WIC-1 ADSL query - use WGET to query the web interface and get a
# "/level/15/exec/-/show/dsl/interface/ATM/1//0/CR" command.
# Issue "show dsl interface" command to Cisco
my $adsl = `$PATHTOWGET -q -T 3 -t 1 -w 3 --http-user $user --http-passwd $password -O - http://$host/level/15/exec/-/show/dsl/interface/ATM/$ifA//$ifB/CR`;
$adsl =~ s/\n/ /g; # Convert newlines
$adsl =~ s/\t/ /g; # Convert tabs
$adsl =~ s/\r/ /g; # Convert returns
# Sanity check output for key expected strings
if ((index($adsl, 'command completed.' ) == -1) ||
(index($adsl, 'Line not activated:' ) != -1) ||
(index($adsl, 'show dsl interface ATM') == -1))
{ $output = "0\n0\n--" }
else
{
if ($measure eq $measureSpeed)
{
# Speed (kbps): 0 6848 0 832
$output = substr($adsl, index($adsl, 'Speed (kbps):'));
my @speedwords = split /\s+/, $output, 7;
my $dnlink = int($speedwords[2]) + int($speedwords[3]);
my $uplink = int($speedwords[4]) + int($speedwords[5]);
$output = "$uplink\n$dnlink\n--";
}
elsif ($measure eq $measureCapacity)
{
# Capacity Used: 100% 89%
$output = substr($adsl, index($adsl, 'Capacity Used:'));
$output =~ s/Capacity Used:\s*(\S*)%\s*(\S*)%(.*)/$2\n$1\n--/;
if (length($output) > 30) { $output = "0\n0\n--" }
}
elsif ($measure eq $measureSNR)
{
# Noise Margin: -44.5 dB 10.0 dB
$output = substr($adsl, index($adsl, 'Noise Margin:'));
$output =~ s/Noise Margin:\s*(\S*)\s*dB\s*(\S*)\s*dB(.*)/$2\n$1\n--/;
if (length($output) > 30) { $output = "0\n0\n--" }
}
elsif ($measure eq $measureEC)
{
# Reed-Solomon EC: 12285 0 34 0
$output = substr($adsl, index($adsl, 'Reed-Solomon EC:'));
my @ecwords = split /\s+/, $output, 7;
my $dnec = int($ecwords[2]) + int($ecwords[3]);
my $upec = int($ecwords[4]) + int($ecwords[5]);
$output = "$upec\n$dnec\n--";
}
elsif ($measure eq $measureCRC)
{
# CRC Errors: 0 56282 11262 10504
$output = substr($adsl, index($adsl, 'CRC Errors:'));
#$output =~ s/CRC Errors:\s*(\S*)\s*(\S*)\s*(\S*)\s*(\S*)(.*)/$4\n$2\n--/;
#if (length($output) > 30) { $output = "0\n0\n--" }
my @crcwords = split /\s+/, $output, 7;
my $dncrc = int($crcwords[2]) + int($crcwords[3]);
my $upcrc = int($crcwords[4]) + int($crcwords[5]);
$output = "$upcrc\n$dncrc\n--";
}
elsif ($measure eq $measureHeader)
{
# Header Errors: 0 51202 11212 10840
$output = substr($adsl, index($adsl, 'Header Errors:'));
#$output =~ s/Header Errors:\s*(\S*)\s*(\S*)\s*(\S*)\s*(\S*)(.*)/$4\n$2\n--/;
#if (length($output) > 30) { $output = "0\n0\n--" }
my @hdrwords = split /\s+/, $output, 7;
my $dnhdr = int($hdrwords[2]) + int($hdrwords[3]);
my $uphdr = int($hdrwords[4]) + int($hdrwords[5]);
$output = "$uphdr\n$dnhdr\n--";
}
elsif ($measure eq $measureAtt)
{
# Attenuation: 38.0 dB 24.0 dB
$output = substr($adsl, index($adsl, 'Attenuation:'));
$output =~ s/Attenuation:\s*(\S*)\s*dB\s*(\S*)\s*dB(.*)/$2\n$1\n--/;
if (length($output) > 30) { $output = "0\n0\n--" }
}
elsif ($measure eq $measureStarts)
{
# Activations: 49
$output = substr($adsl, index($adsl, 'Activations:'));
$output =~ s/Activations:\s*(\S*)\s*(.*)/0\n$1\n--/;
if (length($output) > 30) { $output = "0\n0\n--" }
}
else
{ $output = "0\n0\n--" };
};
# Print 4 lines of output for MRTG, e.g
# 832
# 7645
# --
# ATM0/1
print "$output\nATM".$ifA.'/'.$ifB."\n";
exit;
############################################################################### # # NMS # Directory[_]: Directory[_]: nms # ############################################################################### #Target[NMS-Eth]: ifInOctets.1&ifOutOctets.1:public@10.0.0.3 #Options[NMS-Eth]: growright #Title[NMS-Eth]: NMS: Traffic Analysis #MaxBytes[NMS-Eth]: 10000000000 #WithPeak[NMS-Eth]: ymwd #XSize[NMS-Eth]: 600 #YLegend[NMS-Eth]: Bytes (in, out) #PageTop[NMS-Eth]: <H1>NMS: Ethernet Traffic</H1> # enterprises.ucdavis.memory.memTotalReal.0 # enterprises.ucdavis.memory.memTotalFree.0 #Target[NMS-Mem]: 1.3.6.1.4.1.2021.4.5.0&1.3.6.1.4.1.2021.4.11.0:public@10.0.0.2 #Options[NMS-Mem]: gauge, growright, noinfo, nopercent, nolegend #Title[NMS-Mem]: NMS: Memory (Total, Used) #MaxBytes[NMS-Mem]: 12000000 #WithPeak[NMS-Mem]: ymwd #XSize[NMS-Mem]: 600 #YLegend[NMS-Mem]: Total / Used #LegendO[NMS-Mem]: #LegendI[NMS-Mem]: #PageTop[NMS-Mem]: <H1>NMS: Memory Resources (Total, Used)</H1> # enterprises.ucdavis.laTable.laEntry.laLoad.2 (5 min) # enterprises.ucdavis.laTable.laEntry.laLoad.3 (15 min) Target[NMS-Load]: 1.3.6.1.4.1.2021.10.1.3.2&1.3.6.1.4.1.2021.10.1.3.3:public@10.0.0.2 * 100 Options[NMS-Load]: gauge, growright, noinfo, nopercent Unscaled[NMS-Load]: ymwd Title[NMS-Load]: NMS: CPU Loading (x100) MaxBytes[NMS-Load]: 100 AbsMax[NMS-Load]: 1000 WithPeak[NMS-Load]: ymwd XSize[NMS-Load]: 600 YLegend[NMS-Load]: Load (5min, 15min) x100 LegendO[NMS-Load]: LegendI[NMS-Load]: PageTop[NMS-Load]: <H1>NMS: Processor Loading, 5min, 15min x100</H1> # LoadMIBs: /usr/share/snmp/mibs/HOST-RESOURCES-MIB.txt # Target[NMS-Disk1]:hrStorageUsed.1&hrStorageSize.1:gWiHAjcqlA@10.0.0.2 #Target[NMS-Disk1]: .1.3.6.1.2.1.25.2.3.1.6.1&.1.3.6.1.2.1.25.2.3.1.5.1:public@10.0.0.2 #Options[NMS-Disk1]: growright,gauge,nopercent #Unscaled[NMS-Disk1]: ymwd #MaxBytes[NMS-Disk1]: 20000000 #AbsMax[NMS-Disk1]: 100000000 #Title[NMS-Disk1]: NMS: / (Used, Tot) #kMG[NMS-Disk1]: k,M,G,T,P #YLegend[NMS-Disk1]: / (Used, Tot) #LegendI[NMS-Disk1]: Size #LegendO[NMS-Disk1]: Usage #PageTop[NMS-Disk1]: <H1>NMS: Disk Space: / (Used, Tot)</H1> # LoadMIBs: /usr/share/snmp/mibs/HOST-RESOURCES-MIB.txt # Target[NMS-Disk1]:hrStorageUsed.3&hrStorageSize.1:gWiHAjcqlA@10.0.0.3 #Target[NMS-Disk2]: .1.3.6.1.2.1.25.2.3.1.6.2&.1.3.6.1.2.1.25.2.3.1.5.2:public@10.0.0.2 #Options[NMS-Disk2]: growright,gauge,nopercent #Unscaled[NMS-Disk2]: ymwd #MaxBytes[NMS-Disk2]: 110000 #AbsMax[NMS-Disk2]: 1000000 #Title[NMS-Disk2]: NMS: /boot (Used, Tot) #kMG[NMS-Disk2]: k,M,G,T,P #YLegend[NMS-Disk2]: /boot (Used,Tot) #LegendI[NMS-Disk2]: Size #LegendO[NMS-Disk2]: Usage #PageTop[NMS-Disk2]: <H1>NMS: Disk Space: /boot (Used, Tot)</H1>
############################################################################### # # NetEyes Cyclone-1000 Load Balancing Router # Directory[_]: Directory[_]: cyclone # ############################################################################### Target[Cyclone-Eth]: ifInOctets.1&ifOutOctets.1:public@10.0.0.1 Directory[Cyclone-Eth]: cyclone Title[Cyclone-Eth]: Traffic: Cyclone Ethernet (LAN) MaxBytes1[Cyclone-Eth]: 65536 MaxBytes2[Cyclone-Eth]: 524288 Unscaled[Cyclone-Eth]: ymwd WithPeak[Cyclone-Eth]: ymwd XSize[Cyclone-Eth]: 600 YSize[Cyclone-Eth]: 200 YLegend[Cyclone-Eth]: Bytes (in, out) PageTop[Cyclone-Eth]: <H1>Traffic: Cyclone Ethernet (LAN)</H1> Target[Cyclone-WAN1]: ifInOctets.2&ifOutOctets.2:public@10.0.0.1 Directory[Cyclone-WAN1]: cyclone Title[Cyclone-WAN1]: Traffic: Cyclone Ethernet (WAN1) MaxBytes1[Cyclone-WAN1]: 524288 MaxBytes2[Cyclone-WAN1]: 65536 Unscaled[Cyclone-WAN1]: ymwd WithPeak[Cyclone-WAN1]: ymwd XSize[Cyclone-WAN1]: 600 YLegend[Cyclone-WAN1]: Bytes (in, out) PageTop[Cyclone-WAN1]: <H1>Traffic: Cyclone Ethernet (WAN1)</H1> Target[Cyclone-WAN2]: ifInOctets.3&ifOutOctets.3:public@10.0.0.1 Directory[Cyclone-WAN2]: cyclone Title[Cyclone-WAN2]: Traffic: Cyclone Ethernet (WAN2) MaxBytes1[Cyclone-WAN2]: 524288 MaxBytes2[Cyclone-WAN2]: 65536 Unscaled[Cyclone-WAN2]: ymwd WithPeak[Cyclone-WAN2]: ymwd XSize[Cyclone-WAN2]: 600 YLegend[Cyclone-WAN2]: Bytes (in, out) PageTop[Cyclone-WAN2]: <H1>Traffic: Cyclone Ethernet (WAN2)</H1> Target[Cyclone-WAN3]: ifInOctets.4&ifOutOctets.4:public@10.0.0.1 Directory[Cyclone-WAN3]: cyclone Title[Cyclone-WAN3]: Traffic: Cyclone Ethernet (WAN3) MaxBytes1[Cyclone-WAN3]: 524288 MaxBytes2[Cyclone-WAN3]: 65536 Unscaled[Cyclone-WAN3]: ymwd WithPeak[Cyclone-WAN3]: ymwd XSize[Cyclone-WAN3]: 600 YLegend[Cyclone-WAN3]: Bytes (in, out) PageTop[Cyclone-WAN3]: <H1>Traffic: Cyclone Ethernet (WAN3)</H1> # 1.3.6.1.4.1.ucdavis.memory.memTotalReal.0 # 1.3.6.1.4.1.ucdavis.memory.memAvailReal.0 Target[CycloneRAM]: 1.3.6.1.4.1.2021.4.5.0&1.3.6.1.4.1.2021.4.6.0:public@10.0.0.1: Directory[CycloneRAM]: cyclone Options[CycloneRAM]: gauge, growright, noinfo, nopercent Unscaled[CycloneRAM]: ymwd Suppress[CycloneRAM]: y MaxBytes[CycloneRAM]: 256000 XSize[CycloneRAM]: 600 YLegend[CycloneRAM]: Bytes (Tot, Avail) LegendO[CycloneRAM]: LegendI[CycloneRAM]: Title[CycloneRAM]: Cyclone RAM (Bytes: Tot, Avail) PageTop[CycloneRAM]: <H1>Cyclone RAM (Bytes: Tot, Avail)</H1> # UCD-SNMP-MIB::laLoad.1, laLoad.2 Target[CycloneLoad]: 1.3.6.1.4.1.2021.10.1.3.1&1.3.6.1.4.1.2021.10.1.3.2:public@10.0.0.1 * 100 Directory[CycloneLoad]: cyclone Options[CycloneLoad]: gauge, growright, noinfo, nopercent #Unscaled[CycloneLoad]: ymwd Title[CycloneLoad]: Cyclone CPU Loading (x100) MaxBytes[CycloneLoad]: 50 AbsMax[CycloneLoad]: 200 WithPeak[CycloneLoad]: ymwd XSize[CycloneLoad]: 600 YTics[CycloneLoad]: 5 YLegend[CycloneLoad]: Load (1min, 5min) x100 LegendO[CycloneLoad]: LegendI[CycloneLoad]: PageTop[CycloneLoad]: <H1>Cyclone Processor Loading (x100)</H1> ###############################################################################
Link is a pair of identical hardware, with one labelled and Master and the other Slave. The symmetry of operation means all data may be collected from the nearest unit only.
############################################################################### # # Orthogon Gemini Point-to-Point radio # Directory[_]: Directory[_]: gemini # ############################################################################### Target[Gemini-Eth]: ifInOctets.1&ifOutOctets.1:public@10.0.0.5 Directory[Gemini-Eth]: gemini Options[Gemini-Eth]: growright, noinfo, nopercent Title[Gemini-Eth]: Gemini Traffic Analysis MaxBytes[Gemini-Eth]: 2000000 AbsMax[Gemini-Eth]: 20000000 YLegend[Gemini-Eth]: Bytes (in, out) LegendO[Gemini-Eth]: LegendI[Gemini-Eth]: PageTop[Gemini-Eth]: <H1>Traffic: (Gemini)</H1> # enterprises.gemini.phyStatus.receiveChannel # enterprises.gemini.phyStatus.transmitChannel Target[Gemini-Chnl]: 1.3.6.1.4.1.17713.1.12.6.0&1.3.6.1.4.1.17713.1.12.7.0:public@10.0.0.5 Directory[Gemini-Chnl]: gemini Options[Gemini-Chnl]: gauge, growright, noinfo, nopercent, nolegend Title[Gemini-Chnl]: Gemini Receive / Transmit Channel Unscaled[Gemini-Chnl]: ymwd MaxBytes[Gemini-Chnl]: 20 AbsMax[Gemini-Chnl]: 30 Ytics[Gemini-Chnl]: 10 YLegend[Gemini-Chnl]: Rcv / Xmit LegendO[Gemini-Chnl]: LegendI[Gemini-Chnl]: PageTop[Gemini-Chnl]: <H1>Gemini Receive / Transmit Channel</H1> # enterprises.gemini.phyStatus.transmitPower Target[Gemini-Power]: 1.3.6.1.4.1.17713.1.12.3.0&1.3.6.1.4.1.17713.1.12.3.0:public@10.0.0.5 / 10 Directory[Gemini-Power]: gemini Options[Gemini-Power]: gauge, growright, noinfo, nopercent, nolegend Title[Gemini-Power]: Gemini Xmit Power (max 25dBm) Unscaled[Gemini-Power]: ymwd WithPeak[Gemini-Power]: ymwd #YTics[Gemini-Power]: 6 MaxBytes[Gemini-Power]: 25 AbsMax[Gemini-Power]: 40 YLegend[Gemini-Power]: Transmit Power LegendO[Gemini-Power]: LegendI[Gemini-Power]: PageTop[Gemini-Power]: <H1>Gemini Xmit Power (max 25dBm)</H1> # enterprises.gemini.phyStatus.receiveModulationMode # enterprises.gemini.phyStatus.transmitModulationMode Target[Gemini-Mod]: 1.3.6.1.4.1.17713.1.12.8.0&1.3.6.1.4.1.17713.1.12.9.0:public@10.0.0.5 Directory[Gemini-Mod]: gemini Options[Gemini-Mod]: gauge, growright, noinfo, nopercent, nolegend Title[Gemini-Mod]: Gemini Modulation Mode Unscaled[Gemini-Mod]: ymwd WithPeak[Gemini-Mod]: ymwd MaxBytes[Gemini-Mod]: 8 AbsMax[Gemini-Mod]: 10 YTics[Gemini-Mod]: 8 YLegend[Gemini-Mod]: Rcv / Xmit LegendO[Gemini-Mod]: LegendI[Gemini-Mod]: PageTop[Gemini-Mod]: <H1>Gemini Modulation Mode</H1> # enterprises.gemini.phyStatus.snr #Target[Gemini-SNR]: 1.3.6.1.4.1.17713.1.12.10.0&1.3.6.1.4.1.17713.1.12.10.0:public@10.0.0.5 / 10 #Directory[Gemini-SNR]: gemini #Options[Gemini-SNR]: gauge, growright, noinfo, nopercent, nolegend #Title[Gemini-SNR]: Gemini SNR dBm ##Unscaled[Gemini-SNR]: ymwd #WithPeak[Gemini-SNR]: ymwd #YSize[Gemini-SNR]: 200 #YTics[Gemini-SNR]: 6 #MaxBytes[Gemini-SNR]: 30 #AbsMax[Gemini-SNR]: 500 #YLegend[Gemini-SNR]: SNR #LegendO[Gemini-SNR]: #LegendI[Gemini-SNR]: #PageTop[Gemini-SNR]: <H1>Gemini SNR dBm</H1> # enterprises.gemini.phyStatus.lnkLoss Target[Gemini-linkloss]: 1.3.6.1.4.1.17713.1.12.5.0&1.3.6.1.4.1.17713.1.12.5.0:public@10.0.0.5 / 10 Directory[Gemini-linkloss]: gemini Options[Gemini-linkloss]: gauge, growright, noinfo, nopercent, nolegend Title[Gemini-linkloss]: Gemini Link Loss #Unscaled[Gemini-linkloss]: ymwd WithPeak[Gemini-linkloss]: ymwd YSize[Gemini-linkloss]: 200 YTics[Gemini-linkloss]: 10 MaxBytes[Gemini-linkloss]: 160 AbsMax[Gemini-linkloss]: 500 YLegend[Gemini-linkloss]: Link Loss dBm LegendO[Gemini-linkloss]: LegendI[Gemini-linkloss]: PageTop[Gemini-linkloss]: <H1>Gemini Link Loss</H1> ###############################################################################
Requires perl script (sb-mrtg.pl) to collect and re-format data from unit. Script was downloaded from SmartBridges support.
############################################################################### # # airBridge Traffic Stats # ############################################################################### # Options[_]: Options[_]: growright, noinfo, nopercent XSize[_]: XSize[_]: 350 YSize[_]: YSize[_]: 100 Directory[_]: Directory[_]: sb # ############################################################################### # Target[ab50l]: `sb-mrtg.pl -i 10.0.0.50 -c public -t l` Title[ab50l]: airBridge Radio Link: 10.0.0.50 Options[ab50l]: gauge, growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[ab50l]: 100 Legend1[ab50l]: RSSI % Legend2[ab50l]: Link Quality % YLegend[ab50l]: RSSI & LQ % Unscaled[ab50l]: ymwd PageTop[ab50l]: <H1>airBridge Radio Link: 10.0.0.50 on ICK1</H1> Target[ab50w]: `sb-mrtg.pl -i 10.0.0.50 -c public -t w` Title[ab50w]: airBridge Air Interface Activity: 10.0.0.50 (Packets) Options[ab50w]: growright, integer, nolegend, nobanner, noinfo, perminute MaxBytes[ab50w]: 30000 AbsMax[ab50w]: 100000 YTics[ab50w]: 6 #Unscaled[ab50w]: ymwd WithPeak[ab50w]: ymwd Legend1[ab50w]: Packets In Legend2[ab50w]: Packets Out YLegend[ab50w]: Pkts (in, out) PageTop[ab50w]: <H1>Air Interface Activity: 10.0.0.50 on ICK1 (Packets)</H1> Target[ab50t]: `sb-mrtg.pl -i 10.0.0.50 -c public -t e` Title[ab50t]: airBridge Ethernet Traffic: 10.0.0.50 (Bytes) Options[ab50t]: growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[ab50t]: 100000 AbsMax[ab50t]: 786432 YTics[ab50t]: 5 #Unscaled[ab50t]: ymwd WithPeak[ab50t]: ymwd Legend1[ab50t]: Bytes In Legend2[ab50t]: Bytes Out YLegend[ab50t]: Bytes (in, out) PageTop[ab50t]: <H1>Ethernet Traffic: 10.0.0.50 on ICK1 (Bytes)</H1> ###############################################################################
Link uses a pair of identical hardware but software configured as Master (MU) and Remote (RU) each with a different MIB.
############################################################################### # # TrangoLINK-10 Point-to-Point radio # Directory[_]: Directory[_]: trango # ############################################################################### Target[Trango-MU1]: 1.3.6.1.4.1.5454.1.22.2.5.4.0&1.3.6.1.4.1.5454.1.22.2.1:public@10.0.0.6|TrangoScaleRSSI Options[Trango-MU1]: gauge, growright, noinfo, nopercent, nolegend Unscaled[Trango-MU1]: ymwd WithPeak[Trango-MU1]: ymwd Title[Trango-MU1]: Trango MU RSSI MaxBytes[Trango-MU1]: 40 XSize[Trango-MU1]: 600 YLegend[Trango-MU1]: RSSI + 100 LegendO[Trango-MU1]: LegendI[Trango-MU1]: PageTop[Trango-MU1]: <H1>Trango MU RSSI</H1> Target[Trango-RU1]: 1.3.6.1.4.1.5454.1.24.2.5.4.0&1.3.6.1.4.1.5454.1.24.2.1:public@10.0.0.7|TrangoScaleRSSI Options[Trango-RU1]: gauge, growright, noinfo, nopercent, nolegend Unscaled[Trango-RU1]: ymwd WithPeak[Trango-RU1]: ymwd Title[Trango-RU1]: Trango RU RSSI MaxBytes[Trango-RU1]: 40 XSize[Trango-RU1]: 600 YLegend[Trango-RU1]: RSSI + 100 LegendO[Trango-RU1]: LegendI[Trango-RU1]: PageTop[Trango-RU1]: <H1>Trango RU RSSI</H1> Target[Trango-MU2]: 1.3.6.1.4.1.5454.1.22.1.9.1&1.3.6.1.4.1.5454.1.22.1.9.2:public@10.0.0.6: Options[Trango-MU2]: growright, noinfo, nopercent WithPeak[Trango-MU2]: ymwd Title[Trango-MU2]: Trango Traffic Analysis MaxBytes[Trango-MU2]: 1000000 XSize[Trango-MU2]: 600 YLegend[Trango-MU2]: Bytes (in, out) PageTop[Trango-MU2]: <H1>Traffic (Trango)</H1> Target[Trango-MUTemp]: .1.3.6.1.4.1.5454.1.22.1.10&.1.3.6.1.4.1.5454.1.22.1.10:public@10.0.0.6 Options[Trango-MUTemp]: gauge, growright, noinfo, nopercent, nolegend Unscaled[Trango-MUTemp]: ymwd WithPeak[Trango-MUTemp]: ymwd Title[Trango-MUTemp]: Trango MU Internal Temperature MaxBytes[Trango-MUTemp]: 50 AbsMax[Trango-MUTemp]: 100 XSize[Trango-MUTemp]: 600 Ytics[Trango-MUTemp]: 5 YLegend[Trango-MUTemp]: Deg C LegendO[Trango-MUTemp]: LegendI[Trango-MUTemp]: PageTop[Trango-MUTemp]: <H1>Trango MU Temperature</H1> Target[Trango-RUTemp]: .1.3.6.1.4.1.5454.1.24.1.10&.1.3.6.1.4.1.5454.1.24.1.10:public@10.0.0.7 Options[Trango-RUTemp]: gauge, growright, noinfo, nopercent, nolegend Unscaled[Trango-RUTemp]: ymwd WithPeak[Trango-RUTemp]: ymwd Title[Trango-RUTemp]: Trango RU Internal Temperature MaxBytes[Trango-RUTemp]: 50 AbsMax[Trango-RUTemp]: 100 XSize[Trango-RUTemp]: 600 Ytics[Trango-RUTemp]: 5 YLegend[Trango-RUTemp]: Deg C LegendO[Trango-RUTemp]: LegendI[Trango-RUTemp]: PageTop[Trango-RUTemp]: <H1>Trango RU Temperature</H1> ###############################################################################
/System/Library/LaunchDaemons/tftp.plist
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>InitGroups</key> <true/> <key>Label</key> <string>com.apple.tftpd</string> <key>ProgramArguments</key> <array> <string>/usr/libexec/tftpd</string> <string>-d</string> <string>-i</string> <string>-l</string> <string>-i</string> <string>/private/tftpboot</string> </array> <key>Sockets</key> <dict> <key>Listeners</key> <dict> <key>SockServiceName</key> <string>tftp</string> <key>SockType</key> <string>dgram</string> </dict> </dict> <key>inetdCompatibility</key> <dict> <key>Wait</key> <true/> </dict> </dict> </plist>
http://nagios.org/
http://www.nagiosexchange.org/
http://www.nagioscommunity.org/blog/
#!/usr/bin/perl -w
use strict;
use Net::SNMP;
use Getopt::Long;
use Pod::Usage;
=head1 NAME
check_upsbatt.pl - APC UPS Battery Query
=head1 SYNOPSIS
check_upsbatt.pl -H host [-p community]
host: IP address of unit
community: Community string for host (default is public)
=head1 DESCRIPTION
Uses SNMP query to get the battery status.
=head1 AUTHOR
Nigel Bruin
=cut
###############################################################################
#
# Variables & constants
my ( $host, $community );
my $OutputTag = "UPS:";
# Nagios return codes
my $NagiosOK = 0;
my $NagiosWarning = 1;
my $NagiosCritical = 2;
my $NagiosUnknown = 3;
# SNMP Port
my $PORT = 161;
# APC OIDs
my $OIDAPC = '.1.3.6.1.4.1.318.';
my $OIDhardware = $OIDAPC.'1.1.';
my $OIDups = $OIDhardware.'1.';
my $OIDident = $OIDups.'1.';
my $OIDidentBasic = $OIDident.'1.';
my $OIDidentBasicModel = $OIDidentBasic.'1.0';
my $OIDidentBasicName = $OIDidentBasic.'2.0';
my $OIDidentAdv = $OIDident.'2.';
my $OIDidentAdvFW = $OIDidentAdv.'1.0';
my $OIDidentAdvManuf = $OIDidentAdv.'2.0';
my $OIDidentAdvSerial = $OIDidentAdv.'3.0';
my $OIDbattery = $OIDups.'2.';
my $OIDbatteryBasic = $OIDbattery.'1.';
my $OIDbatteryBasicStatus = $OIDbatteryBasic.'1.0';
my $OIDbatteryBasicTime = $OIDbatteryBasic.'2.0';
my $OIDbatteryBasicRepl = $OIDbatteryBasic.'3.0';
my $OIDbatteryAdv = $OIDbattery.'2.';
my $OIDbatteryAdvTemp = $OIDbatteryAdv.'2.0';
my $OIDbatteryAdvRuntime = $OIDbatteryAdv.'3.0';
my $OIDbatteryAdvReplace = $OIDbatteryAdv.'4.0';
my $BATTERYREPLACE = '2';
my $TEMPCRIT = 55;
my $TEMPWARN = 50;
###############################################################################
#
# SNMP query sub routine
sub snmpQuery
{
my ($session, $result,$resultval,$query);
($session,$query) = @_;
$result = $session->get_request( -varbindlist => [$query]);
if (!defined($result)) { return "" };
return $result->{$query};
};
###############################################################################
#
# Main routine
GetOptions("H=s" => \$host,
"p=s" => \$community,
);
# Enforce parameter defaults
if(!$community) { $community="public" };
# Do some command line options checking
if( !$host )
{ pod2usage("$OutputTag Not enough arguments.\n"); exit $NagiosUnknown; };
# Start the SNMP session
my ($session, $error) = Net::SNMP->session(
-hostname => shift || $host,
-community => shift || $community,
-port => shift || $PORT,
-version => 1,
-timeout => 2,
-retries => 1);
if (!defined($session))
# Persistent failure - give up.
{ print "$OutputTag CRITICAL - No response from unit\n"; exit $NagiosCritical; };
my $batteryAdvTemp = snmpQuery($session, $OIDbatteryAdvTemp );
my $batteryAdvRuntime = snmpQuery($session, $OIDbatteryAdvRuntime );
my $batteryAdvReplace = snmpQuery($session, $OIDbatteryAdvReplace );
# Close SNMP session.
$session->close;
if ($batteryAdvRuntime eq '')
{ $batteryAdvRuntime = '?' }
else
{
# Tidy up the uptime string
$batteryAdvRuntime =~ s/(\d*) hours, 0(\d*):(\d*).(\d*)/$1 hrs, $2 mins/;
$batteryAdvRuntime =~ s/(\d*) hours, (\d*):(\d*).(\d*)/$1 hrs, $2 mins/;
$batteryAdvRuntime =~ s/1 hour, 0(\d*):\d*.\d*/1 hr, $1 mins/;
$batteryAdvRuntime =~ s/1 hour, (\d*):\d*.\d*/1 hr, $1 mins/;
$batteryAdvRuntime =~ s/0(\d*):\d*.\d*/$1 mins/;
$batteryAdvRuntime =~ s/(\d*):\d*.\d*/$1 mins/;
};
if (($batteryAdvReplace ne '') && ($batteryAdvReplace eq $BATTERYREPLACE))
{ print "$OutputTag CRITICAL - Battery requires replacement\n"; exit $NagiosCritical; };
if ($batteryAdvTemp eq '')
{ $batteryAdvTemp = '?' }
elsif ($batteryAdvTemp >= $TEMPCRIT)
{ print "$OutputTag CRITICAL - Battery hot\n"; exit $NagiosCritical; }
elsif ($batteryAdvTemp >= $TEMPWARN)
{ print "$OutputTag WARNING - Battery hot\n"; exit $NagiosWarning; };
print "$OutputTag OK - Run time=$batteryAdvRuntime, Temp=$batteryAdvTemp C\n";
exit $NagiosOK;
Example services.cfg:
# Power Monitor: SNMP (Input Voltage) Service Definition
define service{
use generic-service
host_name Net_UPS4
service_description Voltage
is_volatile 0
check_period 24x7
max_check_attempts 1
normal_check_interval 1
retry_check_interval 1
contact_groups nagios-admins
notification_interval 60
notification_period 24x7
notification_options c,w,r
check_command check_ups!-p public
}
Perl code:
#!/usr/bin/perl -w
use strict;
use Net::SNMP;
use Getopt::Long;
use Pod::Usage;
=head1 NAME
check_ups.pl - APC UPS Query
=head1 SYNOPSIS
check_ups.pl -H host [-p community]
host: IP address of unit
community: Community string for host (default is public)
=head1 DESCRIPTION
Uses SNMP query to get the input voltage values.
=head1 AUTHOR
Nigel Bruin
=cut
###############################################################################
#
# Variables & constants
my ( $host, $community, $volts, $volt, $iterations, $okay );
my $OutputTag = "UPS:";
# Nagios return codes
my $NagiosOK = 0;
my $NagiosWarning = 1;
my $NagiosCritical = 2;
my $NagiosUnknown = 3;
# Constants
my $VOLTWARN = 210;
my $VOLTCRIT = 190;
# SNMP Port
my $PORT = 161;
# APC OID for input voltage
my $VoltageOID = '.1.3.6.1.4.1.318.1.1.1.3.2.1.0';
###############################################################################
#
# SNMP query sub routine
sub snmpQuery
{
my ($session, $result,$resultval,$query);
($session,$query) = @_;
$result = $session->get_request( -varbindlist => [$query]);
if (!defined($result)) { return "" };
return $result->{$query};
};
###############################################################################
#
# Main routine
GetOptions("H=s" => \$host,
"p=s" => \$community,
);
# Enforce parameter defaults
if(!$community) { $community="public" };
# Do some command line options checking
if( !$host )
{ pod2usage("$OutputTag Not enough arguments.\n"); exit 3; };
# Start the SNMP session
my ($session, $error) = Net::SNMP->session(
-hostname => shift || $host,
-community => shift || $community,
-port => shift || $PORT,
-version => 1,
-timeout => 2,
-retries => 0);
if (!defined($session))
# Persistent failure - give up.
{ print "$OutputTag CRITICAL - No response from unit\n"; exit 2; };
# We loop obsessively until we get PASS values.
$volt = 0;
$iterations = 0;
do
{
$iterations++;
$volts = snmpQuery($session, $VoltageOID);
if (defined($volts) && ($volts ne '')) {
if ($volts > $volt) { $volt = $volts }
};
}
while ( ($iterations < 5) && ($volt <= $VOLTWARN) );
# Close SNMP session.
$session->close;
# Generate response text for Nagios
if ($volt <= $VOLTCRIT)
{ print "$OutputTag CRITICAL - $volt" . "V \n"; exit 2; };
if ($volt <= $VOLTWARN)
{ print "$OutputTag WARNING - $volt" . "V \n"; exit 1; };
print "$OutputTag OK - $volt" . "V \n";
exit $NagiosOK;
Example services.cfg:
# Access Point SNMP (SSIDs) Service Definition
define service{
use generic-service
host_name APIckford1,APIckford2
service_description SSID
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups nagios-admins
notification_interval 60
notification_period 24x7
notification_options c,r
check_command check_ap2000!public
}
Perl code:
#!/usr/bin/perl -w
use strict;
use Net::SNMP;
use Getopt::Long;
use Pod::Usage;
=head1 NAME
check_ap2000.pl - Show Proxim AP2000 radio SSIDs
=head1 SYNOPSIS
check_ap2000.pl -H host [-p community]
host: IP address of the access point
community: Community string for host (default: public)
=head1 DESCRIPTION
Uses SNMP query to get the access point's SSIDs.
=head1 AUTHOR
Nigel Bruin. 2005
=cut
###############################################################################
#
# Constants and global variables
my $OutputTag = 'SSIDs:';
# SNMP Port
my $PORT = 161;
# OIDs for Proxim radio parameters
my $OID_IndexA = '1.3.6.1.4.1.11898.2.1.2.1.2.1.1.3';
my $OID_IndexB = '1.3.6.1.4.1.11898.2.1.2.1.2.1.1.4';
my $OID_RadioA = '1.3.6.1.4.1.11898.2.1.2.1.3.1.2.3.1';
my $OID_RadioB = '1.3.6.1.4.1.11898.2.1.2.1.3.1.2.4.1';
# Nagios return codes
my $NagiosOK = 0;
my $NagiosWarning = 1;
my $NagiosCritical = 2;
my $NagiosUnknown = 3;
my ( $host, $community, $oid );
###############################################################################
#
# The actual query control, depending on the type.
sub snmpQuery {
my ( $session, $result, $resultval, $query );
( $session, $query ) = @_;
$result = $session->get_request( -varbindlist => [$query]);
if (!defined($result)) {
return;
}
$resultval = $result->{$query};
return $resultval;
};
###############################################################################
#
# Main routine
GetOptions(
"H=s" => \$host,
"p=s" => \$community
);
# Enforce parameter defaults
if(!$community) { $community = 'public' };
# Do some command line options checking
if ( !$host ){
pod2usage("$OutputTag Not enough arguments.\n");
exit $NagiosUnknown;
}
# Start the SNMP session
my ($session, $error) = Net::SNMP->session(
-hostname => shift || $host,
-community => shift || $community,
-port => shift || $PORT,
-version => 1,
-timeout => 2,
-retries => 2);
my $numSSID = 0;
if (!defined($session))
# Persistent failure - give up.
{ print "$OutputTag CRITICAL - No response from $host \n"; exit $NagiosCritical; };
my $radioAssid = '';
my $idx = snmpQuery($session, $OID_IndexA);
if (defined($idx))
{
my $ssid = snmpQuery($session, $OID_RadioA);
if (defined($ssid))
{ $radioAssid = '"'.$radioAssid.$ssid.'"'; $numSSID++ };
};
my $radioBssid = '';
$idx = snmpQuery($session, $OID_IndexB);
if (defined($idx))
{
my $ssid = snmpQuery($session, $OID_RadioB);
if (defined($ssid))
{ $radioBssid = '"'.$radioBssid.$ssid.'"'; $numSSID++ }
};
# Generate answer
if ($numSSID == 0)
{ print "$OutputTag CRITICAL - No response from $host \n"; exit $NagiosCritical };
print "$OutputTag OK - $radioAssid $radioBssid\n";
exit $NagiosOK;
Example services.cfg:
# Orthogon: Link Loss Service Definition
define service{
use generic-service
host_name Net_WRM-ICK2
service_description Link-Loss
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 2
retry_check_interval 1
contact_groups nagios-admins
notification_interval 120
notification_period 24x7
notification_options c,w,r
check_command check_geminiloss!-p public -w 150 -c 160
}
Perl code:
#!/usr/bin/perl -w
use strict;
use Net::SNMP;
use Getopt::Long;
use Pod::Usage;
=head1 NAME
check_geminiloss.pl - Orthogon Gemini Link Loss Query
=head1 SYNOPSIS
check_geminiloss.pl -H host [-p community] [-o oid] -w wlevel -c clevel
host: The Gemini radio
community: Community string for host (default: public)
oid: MIB object id to query (default: 1.3.6.1.4.1.17713.1.12.5.0)
wlevel: Warning treshhold (default: 160)
clevel: Critical treshhold (default: 170)
=head1 DESCRIPTION
Uses SNMP query to get the radio's current link loss and compares
it against warning & critical levels.
=head1 AUTHOR
Nigel Bruin. 2005
=cut
###############################################################################
#
# Constants and global variables
my $OutputTag = "Link Loss:";
# SNMP Port
my $PORT = 161;
# Loss NIL value
my $NILLOSS = '100000000';
# Nagios return codes
my $NagiosOK = 0;
my $NagiosWarning = 1;
my $NagiosCritical = 2;
my $NagiosUnknown = 3;
my ( $host, $community, $oid, $wlevel, $clevel );
###############################################################################
#
# The actual query control, depending on the type.
sub snmpQuery {
my ( $session, $result, $resultval, $query );
( $session, $query ) = @_;
$result = $session->get_request( -varbindlist => [$query]);
if (!defined($result)) {
return;
}
$resultval = $result->{$query};
return $resultval;
};
###############################################################################
#
# Main routine
#
# We fetch the radio parameters twice and use the better RSSI and LQ values
GetOptions(
"H=s" => \$host,
"p=s" => \$community,
"o=s" => \$oid,
"w=i" => \$wlevel,
"c=i" => \$clevel
);
# Enforce parameter defaults
if(!$community) { $community = "public" };
if(!$oid ) { $oid = "1.3.6.1.4.1.17713.1.12.5.0" };
if(!$clevel ) { $clevel = "170" };
if(!$wlevel ) { $wlevel = "160" };
# Do some command line options checking
if ( !$host ){
pod2usage("$OutputTag Not enough arguments.\n");
exit $NagiosUnknown;
}
if ( $wlevel > $clevel ){
pod2usage("$OutputTag wlevel is less than clevel\n");
exit $NagiosUnknown;
}
# Start the SNMP session
my ($session, $error) = Net::SNMP->session(
-hostname => shift || $host,
-community => shift || $community,
-port => shift || $PORT,
-version => 1,
-timeout => 2,
-retries => 0);
if (!defined($session))
# Persistent failure - give up.
{ print "$OutputTag CRITICAL - No response from unit\n"; exit $NagiosCritical; };
# We take an optimistic view. Loop several times, getting the
# unit's link loss and use the best of the values returned.
my $loss = $NILLOSS;
for ( my $loop = 1 ; $loop < 5 ; $loop++ )
{
my $losstemp = snmpQuery($session, $oid);
if (defined($losstemp)) {
if ($losstemp < $loss) { $loss = $losstemp };
sleep(1);
}
};
# Generate answer
if ($loss == $NILLOSS)
{ print "$OutputTag CRITICAL - No response from unit\n"; exit $NagiosCritical };
my $lossint = int($loss / 10);
if ($lossint gt $clevel)
{ print "$OutputTag CRITICAL - $lossint dB\n"; exit $NagiosCritical };
if ($lossint ge $wlevel)
{ print "$OutputTag WARNING - $lossint dB\n"; exit $NagiosWarning };
print "$OutputTag OK - $lossint dB\n";
exit $NagiosOK;
#!/usr/bin/perl -w
use strict;
use Net::SNMP;
use Getopt::Long;
use Pod::Usage;
=head1 NAME
check_geminimod.pl - Orthogon Gemini Modulation Mode Query
=head1 SYNOPSIS
check_geminimod.pl -H host [-p community] [-o oid] [ -w wlevel ] [ -c clevel ]
host: The Gemini radio
community: Community string for host (default: public)
oid: MIB object id to query (default: 1.3.6.1.4.1.17713.1.12.8.0)
wlevel: Warning treshhold (default: 1)
clevel: Critical treshhold (default: 0)
=head1 DESCRIPTION
Uses SNMP query to get the radio's current modulation mode and compares
it against warning & critical levels.
=head1 AUTHOR
Nigel Bruin. 2005
=cut
###############################################################################
#
# Constants and global variables
my $OutputTag = "Modulation:";
# SNMP Port
my $PORT = 161;
# Nagios return codes
my $NagiosOK = 0;
my $NagiosWarning = 1;
my $NagiosCritical = 2;
my $NagiosUnknown = 3;
my ( $host, $community, $oid, $wlevel, $clevel );
###############################################################################
#
# The actual query control, depending on the type.
sub snmpQuery {
my ($session, $result,$resultval,$query);
($session,$query) = @_;
$result = $session->get_request( -varbindlist => [$query]);
if (!defined($result)) {
return;
}
$resultval = $result->{$query};
return $resultval;
};
###############################################################################
#
# Main routine
#
# We fetch the radio parameters twice and use the better RSSI and LQ values
GetOptions(
"H=s" => \$host,
"p=s" => \$community,
"o=s" => \$oid,
"w=i" => \$wlevel,
"c=i" => \$clevel
);
# Enforce parameter defaults
if(!$community) { $community = "public" };
if(!$oid ) { $oid = "1.3.6.1.4.1.17713.1.12.8.0" };
if(!$clevel ) { $clevel = "0" };
if(!$wlevel ) { $wlevel = "1" };
# Do some command line options checking
if( !$host ){
pod2usage("$OutputTag Not enough arguments.\n");
exit $NagiosUnknown;
}
if($wlevel<=$clevel){
pod2usage("$OutputTag wlevel is greater clevel\n");
exit $NagiosUnknown;
}
# Start the SNMP session
my ($session, $error) = Net::SNMP->session(
-hostname => shift || $host,
-community => shift || $community,
-port => shift || $PORT,
-version => 1,
-timeout => 2,
-retries => 0);
if (!defined($session))
# Persistent failure - give up.
{ print "$OutputTag CRITICAL - No response from unit\n"; exit $NagiosCritical };
# We take an optimistic view. Loop several times, getting the
# unit's modulation and use the highest of the values returned.
my $mod = "0";
for ( my $loop = 1 ; $loop < 6 ; $loop++ )
{
my $modtemp = snmpQuery($session, $oid);
if (defined($modtemp)) {
if ($modtemp gt $mod) { $mod = $modtemp };
sleep(1);
}
};
# Convert integer coding to a human readable string
my $MOD = "UNKNOWN";
if ($mod eq "0") { $MOD = "0-[........] Link Aquisition (zeroMbps)" };
if ($mod eq "1") { $MOD = "1-[*.......] BPSK-1-2 (1.6Mbps)" };
if ($mod eq "2") { $MOD = "2-[**......] QPSK-1-2 (3.8Mbps)" };
if ($mod eq "3") { $MOD = "3-[***.....] QPSK-2-3 (5.0Mbps)" };
if ($mod eq "4") { $MOD = "4-[****....] 16QAM-1-2 (7.5Mbps)" };
if ($mod eq "5") { $MOD = "5-[*****...] 16QAM-3-4 (11.3Mbps)" };
if ($mod eq "6") { $MOD = "6-[******..] 64QAM-2-3 (15.1Mbps)" };
if ($mod eq "7") { $MOD = "7-[*******.] 64QAM-3-4 (16.9Mbps)" };
if ($mod eq "8") { $MOD = "8-[********] 64QAM-7-8 (19.8Mbps)" };
# Generate answer
if ($mod le $clevel)
{ print "$OutputTag CRITICAL - $MOD\n"; exit $NagiosCritical };
if ($mod le $wlevel)
{ print "$OutputTag WARNING - $MOD\n"; exit $NagiosWarning };
print "$OutputTag OK - $MOD\n";
exit $NagiosOK;
Example services.cfg:
# airBridge CPE SNMP-based Service definitions
define service{
use generic-service
hostgroup_name ickford1
service_description SNMP
is_volatile 0
check_period 24x7
max_check_attempts 2
normal_check_interval 10
retry_check_interval 2
contact_groups nagios-admins
notification_interval 1440 ; 1 day reminders only
notification_period 24x7
notification_options c,r
check_command check_airbridge ; Shouldn't need -p password option
}
Perl code:
#!/usr/bin/perl -w
use strict;
use Net::SNMP;
use Getopt::Long;
use Pod::Usage;
=head1 NAME
check_airbridge.pl - SmartBridges AirBridge Query
=head1 SYNOPSIS
check_airbridge.pl -H host [-p community] [-wr rw%] [-cr rc%] [-wl wl%] [-cl cl%]
host: IP address of the airBridge
community: Community string for host (default: public)
wr%: RSSI warning threshold (%) (default: 35)
cl%: RSSI critical threshold (%) (default; 25)
wl%: LQ warning threshold (%) (default; 40)
cl%: LQ critical threshold (%) (default: 25)
=head1 DESCRIPTION
Uses an SNMP query to get the RSSI and Link Quality values from the airBridge.
These are filtered for rogue values and compared against warning & critical levels.
Output is Nagios compliant in format and return code.
=head1 AUTHOR
Nigel Bruin
=cut
###############################################################################
#
# Constants
# Text printed at beginning of script output.
my $OutputTag = "airBridge:";
# SNMP Port
my $PORT = 161;
# airBridge SNMP OID for radio parameters
my $MediaOID = '1.3.6.1.4.1.410.1.2.8.1.0';
# Atmel radio parameters maximum
my $MAX_RSSI = 40.0;
# Number of times to check a radio before giving up
my $MAXITERATIONS = 3;
my $CHECKINTERVAL = 10;
# Nagios return codes
my $NagiosOK = 0;
my $NagiosWarning = 1;
my $NagiosCritical = 2;
my $NagiosUnknown = 3;
###############################################################################
#
# Global variables
my ( $host, $community, $rssiWarn, $rssiCrit, $linkWarn, $linkCrit );
my ( $RBytes, $link1, $rssi1, $okay );
###############################################################################
#
# SNMP query sub routine
sub snmpQuery {
my ($session, $result,$resultval,$query);
($session,$query) = @_;
$result = $session->get_request( -varbindlist => [$query]);
if (!defined($result)) { return "" };
return $result->{$query};
};
###############################################################################
#
# Main routine
GetOptions("H=s" => \$host,
"p=s" => \$community,
"cr=i" => \$rssiCrit,
"cl=i" => \$linkCrit,
"wr=i" => \$rssiWarn,
"wl=i" => \$linkWarn,
);
# Enforce parameter defaults
if(!$community) { $community = "public" };
if(!$rssiCrit ) { $rssiCrit = 25 };
if(!$linkCrit ) { $linkCrit = 25 };
if(!$rssiWarn ) { $rssiWarn = 35 };
if(!$linkWarn ) { $linkWarn = 40 };
# Command line options checking
if ( !$host )
{ pod2usage("$OutputTag Not enough arguments.\n"); exit $NagiosUnknown };
if ( ($rssiCrit > 100) || ($linkCrit > 100) || ($rssiWarn > 100) || ($linkWarn > 100) )
{ pod2usage("$OutputTag Parameter error.\n"); exit $NagiosUnknown };
if ( $linkCrit >= $linkWarn )
{ pod2usage("$OutputTag LQ Critical must be less than LQ warning.\n"); exit $NagiosUnknown };
if ( $rssiCrit >= $rssiWarn )
{ pod2usage("$OutputTag RSSI Critical must be less than RSSi warning.\n"); exit $NagiosUnknown };
# Start the SNMP session
my ($session, $error) = Net::SNMP->session(
-hostname => shift || $host,
-community => shift || $community,
-port => $PORT,
-version => 1,
-timeout => 2,
-retries => 1);
if (!defined($session))
# Cannot continue - give up.
{ print "$OutputTag CRITICAL - No response from $host \n"; exit $NagiosCritical };
# We loop obsessively until we get PASS values.
my $link = 0;
my $rssi = 0;
my $iterations = 0;
do
{
# Get the airBridge radio parameters
$RBytes = snmpQuery($session, $MediaOID);
if ($RBytes)
{
# Extract RSSI and SNR values from Atmel MIB structure.
$rssi1 = hex(substr($RBytes, 22, 2));
$link1 = hex(substr($RBytes, 30, 2));
# The MAX_RSSI for smartBridges radios is 40. This is a baseband processor
# default, and is used for calculation of the Roaming threshold and
# other parameters in the operaion of the channel. The different values
# are also used for RSSI in a relative manner for other functions. For
# the purpose of representation, the MAX_RSSI is scaled as per the Radio
# to show a percentage value. In dBm, the same would range from -95 dBm
# to -10 dBm. In the next few lines we just convert the RSSI value to a
# percentage.
if ($rssi1 > $MAX_RSSI) { $rssi1 = $MAX_RSSI };
if ($link1 > $MAX_RSSI) { $link1 = 0 };
$link1 = int (( ($MAX_RSSI - $link1) / $MAX_RSSI ) * 100);
$rssi1 = int (( $rssi1 / $MAX_RSSI ) * 100);
# Use the best values which represents a optimistc atitude.
if ($rssi1 > $rssi) { $rssi = $rssi1 };
if ($link1 > $link) { $link = $link1 };
};
$okay = (($rssi > $rssiWarn) && ($link > $linkWarn));
# Wait if we haven't got OK values yet, but only if we got a valid response
# from the unit so we don't wait for a unit that is unresponsive or absent.
#if (!$okay && ($RBytes)) { sleep($CHECKINTERVAL) };
if (!$okay) { sleep($CHECKINTERVAL) };
}
# Keep looping until either the values will pass as OK, or we are taking too long
while ( ($iterations++ < $MAXITERATIONS) && (!$okay) );
# Close SNMP session.
$session->close;
# Generate response text for Nagios
if (($rssi == 0) && ($link == 0))
{ print "$OutputTag CRITICAL - No response from $host \n"; exit $NagiosCritical };
if ($rssi < $rssiCrit)
{ print "$OutputTag CRITICAL - *RSSI=$rssi%, LQ=$link%\n"; exit $NagiosCritical };
if ($link < $linkCrit)
{ print "$OutputTag CRITICAL - RSSI=$rssi%, *LQ=$link%\n"; exit $NagiosCritical };
if ($rssi < $rssiWarn)
{ print "$OutputTag WARNING - *RSSI=$rssi%, LQ=$link%\n"; exit $NagiosWarning };
if ($link < $linkWarn)
{ print "$OutputTag WARNING - RSSI=$rssi%, *LQ=$link%\n"; exit $NagiosWarning };
print "$OutputTag OK - RSSI=$rssi%, LQ=$link%\n";
exit $NagiosOK;
Example services.cfg:
# Trango Master: SNMP RSSI Service Definition
define service{
use generic-service
host_name Net_WRM-WRN
service_description RSSI
is_volatile 0
check_period 24x7
max_check_attempts 2
normal_check_interval 2
retry_check_interval 1
contact_groups nagios-admins
notification_interval 0
notification_period 24x7
notification_options c,r
check_command check_trangorssi! -w 83 -c 88 -p public -o 1.3.6.1.4.1.5454.1.22.2.1.0
}
# Trango Slave: SNMP RSSI Service Definition
define service{
use generic-service
host_name Net_WRN-WRM
service_description RSSI
is_volatile 0
check_period 24x7
max_check_attempts 2
normal_check_interval 2
retry_check_interval 1
contact_groups nagios-admins
notification_interval 0
notification_period 24x7
notification_options c,r
check_command check_trangorssi! -w 83 -c 88 -p public -o 1.3.6.1.4.1.5454.1.24.2.1.0
}
Perl code:
#!/usr/bin/perl -w
use strict;
use Net::DNS;
use Getopt::Long;
use Pod::Usage;
=head1 NAME
check_trangorssi.pl - TrangoLink10 RSSI Query
=head1 SYNOPSIS
check_hosts.pl -H host [-p community] [-o oid] -w wlevel -c clevel
host: The Trango radio (master
community: Community string for host (default is public)
oid: MIB object ID to query (default is 1.3.6.1.4.1.5454.1.22.2.1.0).
wlevel: Warning treshhold (dBm)
clevel: Critical treshhold (dBm)
=head1 DESCRIPTION
Uses SNMP query to get the RSSI and filter for rogue values and compare
against warning & critical levels.
=head1 AUTHOR
Nigel Bruin
=cut
1
###############################################################################
#
# Constants
# Text printed at beginning of script output.
my $OutputTag = "RSSI:";
# Nagios return codes
my $NagiosOK = 0;
my $NagiosWarning = 1;
my $NagiosCritical = 2;
my $NagiosUnknown = 3;
###############################################################################
#
# Variables
my ( $host, $community, $oid, $wlevel, $clevel, $cmd);
my $lowerthres = "-96";
GetOptions(
"H=s" => \$host,
"p=s" => \$community,
"o=s" => \$oid,
"w=i" => \$wlevel,
"c=i" => \$clevel
);
# Enforce parameter defaults
if(!$community) { $community = "public" };
if(!$oid ) { $oid = "1.3.6.1.4.1.5454.1.22.2.1.0" };
# Do some command line options checking
if( !$host || !$wlevel || !$clevel){
pod2usage("$0: Not enough arguments.\n");
exit $NagiosUnknown;
};
if($wlevel>=$clevel){
pod2usage("$0: wlevel is greater clevel\n");
exit $NagiosUnknown;
};
# The SNMPGET & sleep commands we are going to use
my $snmpget = "/usr/bin/snmpget -v 1 -c $community -Oqvn -r 2 -t 1 $host $oid";
my $sleep = "/bin/sleep 5";
$cmd = `$snmpget`;
if ($?) { print "$OutputTag CRITICAL - Invalid response\n"; exit 2; };
chomp ($cmd);
if ($cmd < $lowerthres)
{
# Possible rogue reply -- retry after a short delay to settle the radio
$cmd = `$sleep; $snmpget`;
if ($?) { print "$OutputTag CRITICAL - Invalid response\n"; exit 2; };
chomp ($cmd);
};
# Generate answer
if ($cmd < $lowerthres)
{ print "$OutputTag CRITICAL - Invalid response\n"; exit 2; };
if ($cmd<"-$clevel")
{ print "$OutputTag CRITICAL - $cmd dBm\n"; exit 2; };
if ($cmd<"-$wlevel")
{ print "$OutputTag WARNING - $cmd dBm\n"; exit 1; };
print "$OutputTag OK - $cmd dBm\n";
exit 0; # Nagios: OK
Example services.cfg:
define service{
use generic-service
host_name Net_Cyclone
service_description Uptime
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 15
retry_check_interval 1
contact_groups nagios-admins
notification_interval 0
notification_period 24x7
notification_options n
# System uptime.
check_command check_uptime!public
}
Perl code:
#!/usr/bin/perl -w
use strict;
use Net::SNMP;
use Getopt::Long;
use Pod::Usage;
=head1 NAME
check_uptime.pl - Get standard Uptime value
=head1 SYNOPSIS
check_uptime.pl -H host [-p community] [-o oid]
host: The host's IP address
community: Community string for host (default: public)
oid: MIB object id to query (default: 1.3.6.1.2.1.1.3.0)
=head1 DESCRIPTION
Uses SNMP query to get the unit uptime.
=head1 AUTHOR
Nigel Bruin. 2005
=cut
###############################################################################
#
# Constants and global variables
my $OutputTag = 'Uptime:';
# SNMP Port
my $PORT = 161;
# Nagios return codes
my $NagiosOK = 0;
my $NagiosWarning = 1;
my $NagiosCritical = 2;
my $NagiosUnknown = 3;
my ( $host, $community, $oid );
###############################################################################
#
# The actual query control, depending on the type.
sub snmpQuery {
my ( $session, $result, $resultval, $query );
( $session, $query ) = @_;
$result = $session->get_request( -varbindlist => [$query]);
if (!defined($result)) {
return;
}
$resultval = $result->{$query};
return $resultval;
};
###############################################################################
#
# Main routine
GetOptions(
"H=s" => \$host,
"p=s" => \$community,
"o=s" => \$oid
);
# Enforce parameter defaults
if(!$community) { $community = 'public' };
if(!$oid ) { $oid = '1.3.6.1.2.1.1.3.0' };
# Do some command line options checking
if ( !$host ){
pod2usage("$OutputTag Not enough arguments.\n");
exit $NagiosUnknown;
}
# Start the SNMP session
my ($session, $error) = Net::SNMP->session(
-hostname => shift || $host,
-community => shift || $community,
-port => shift || $PORT,
-version => 1,
-timeout => 2,
-retries => 2);
if (!defined($session))
{ print "$OutputTag CRITICAL - No response from $host \n"; exit $NagiosCritical };
my $uptime = snmpQuery($session, $oid);
if (!defined($uptime))
{ print "$OutputTag CRITICAL - No response from $host \n"; exit $NagiosCritical };
# Generate answer
print "$OutputTag OK - $uptime\n";
exit $NagiosOK;
Using launchd to automatically run nagios.
/System/Library/LaunchDaemons/com.wisp.nagios.plist
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>nagios</string> <key>OnDemand</key> <false/> <key>ProgramArguments</key> <array> <string>/usr/local/nagios/bin/nagios</string> <string>/usr/local/nagios/etc/nagios.cfg</string> </array> <key>RunAtLoad</key> <true/> </dict> </plist>
################################################################################
# WISP Broadband object config file for Nagios
#
################################################################################
################################################################################
# COMMAND DEFINITIONS
#
# SYNTAX:
#
# define command{
# template
# name
# command_name
# command_line
# }
# WHERE:
#
# = object name of another command definition that should be
# used as a template for this definition (optional)
# = object name of command definition, referenced by other
# command definitions that use it as a template (optional)
# = name of the command, as recognized/used by Nagios
# = command line
#
################################################################################
################################################################################
#
# SERVICE CHECK COMMANDS
#
################################################################################
# 'check_tcp' command definition
define command{
command_name check_tcp
command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$
}
# 'check_udp' command definition
define command{
command_name check_udp
command_line $USER1$/check_udp -H $HOSTADDRESS$ -p $ARG1$
}
# 'check_ssh' command definition
define command{
command_name check_ssh
command_line $USER1$/check_ssh -H $HOSTADDRESS$
}
# 'check_ftp' command definition
define command{
command_name check_ftp
command_line $USER1$/check_ftp -H $HOSTADDRESS$
}
# 'check_pop' command definition
define command{
command_name check_pop
command_line $USER1$/check_pop -H $HOSTADDRESS$
}
# 'check_snmp' command definition
define command{
command_name check_snmp
command_line $USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$
}
# 'check_smtp' command definition
define command{
command_name check_smtp
command_line $USER1$/check_smtp -H $HOSTADDRESS$ $ARG1$
}
# 'check_nntp' command definition
define command{
command_name check_nntp
command_line $USER1$/check_nntp -H $HOSTADDRESS$ $ARG1$
}
# 'check_http' command definition
define command{
command_name check_http
command_line $USER1$/check_http -H $HOSTADDRESS$ $ARG1$
}
# 'check_telnet' command definition
define command{
command_name check_telnet
command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p 23
}
# 'check_ping' command definition
define command{
command_name check_ping
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ $ARG3$
}
# 'check_icmp' command definition
define command{
command_name check_icmp
command_line $USER1$/check_icmp -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$
}
# 'check_keepalive' command definition
define command{
command_name check_keepalive
command_line $USER1$/check_keepalive.pl
}
# 'check_dns' command definition
define command{
command_name check_dns
# Changed to use dig as chek_dns seemed to give too many false alarms
# command_line $USER1$/check_dns -H www.yahoo.com -s $HOSTADDRESS$
command_line $USER1$/check_dig -H $HOSTADDRESS$ -l www.yahoo.com -t 20
}
# 'check_dig' command definition
define command{
command_name check_dig
command_line $USER1$/check_dig -H $HOSTADDRESS$ $ARG1$
}
# 'check_host' command definition
define command{
command_name check_host
command_line $USER1$/check_dns.pl $ARG1$
}
# 'check_hosts' command definition
define command{
command_name check_hosts
command_line $USER1$/check_hosts.pl -H $HOSTADDRESS$ $ARG1$
}
# 'check_trangorssi' command definition
define command{
command_name check_trangorssi
command_line $USER1$/check_trangorssi.pl -H $HOSTADDRESS$ $ARG1$
}
# 'check_geminimod' command definition
define command{
command_name check_geminimod
command_line $USER1$/check_geminimod.pl -H $HOSTADDRESS$ $ARG1$
}
# 'check_geminiloss' command definition
define command{
command_name check_geminiloss
command_line $USER1$/check_geminiloss.pl -H $HOSTADDRESS$ $ARG1$
}
# 'check_airbridge' command definition
define command{
command_name check_airbridge
command_line $USER1$/check_airbridge.pl -H $HOSTADDRESS$ $ARG1$
}
# 'check_ups' command definition
define command{
command_name check_ups
command_line $USER1$/check_ups.pl -H $HOSTADDRESS$ $ARG1$
}
# 'check_upsbatt' command definition
define command{
command_name check_upsbatt
command_line $USER1$/check_upsbatt.pl -H $HOSTADDRESS$ $ARG1$
}
# 'check_multiups' command definition
define command{
command_name check_multiups
command_line $USER1$/check_multiups.pl $ARG1$
}
# 'check_bonding' command definition
define command{
command_name check_bonding
command_line $USER1$/check_bonding.pl -H $HOSTADDRESS$ $ARG1$
}
# 'check_multilinkppp' command definition
define command{
command_name check_multilinkppp
command_line $USER1$/check_multilinkppp.pl -H $HOSTADDRESS$ $ARG1$
}
# 'check_wicadsl' command definition
define command{
command_name check_wicadsl
command_line $USER1$/check_wicadsl.pl -H $HOSTADDRESS$ $ARG1$
}
# 'check_atm' command definition
define command{
command_name check_atm
command_line $USER1$/check_atm.pl -H $HOSTADDRESS$ $ARG1$
}
# 'check_ap2000' command definition
define command{
command_name check_ap2000
command_line $USER1$/check_ap2000.pl -H $HOSTADDRESS$ -p $ARG1$
}
# 'check_hpjd' command definition
define command{
command_name check_hpjd
command_line $USER1$/check_hpjd -H $HOSTADDRESS$ -C public
}
# 'check_local_disk' command definition
define command{
command_name check_local_disk
command_line $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
}
# 'check_local_users' command definition
define command{
command_name check_local_users
command_line $USER1$/check_users -w $ARG1$ -c $ARG2$
}
# 'check_local_procs' command definition
define command{
command_name check_local_procs
command_line $USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$
}
# 'check_local_load' command definition
define command{
command_name check_local_load
command_line $USER1$/check_load -w $ARG1$ -c $ARG2$
}
# 'check_uptime' command definition
define command{
command_name check_uptime
# command_line $USER1$/check_snmp -H $HOSTADDRESS$ -o .1.3.6.1.2.1.1.3.0 -C $ARG1$ -t 5 -m :
command_line $USER1$/check_uptime.pl -H $HOSTADDRESS$ -p $ARG1$
}
################################################################################
#
# HOST CHECK COMMANDS
#
################################################################################
# This command checks to see if a host is "alive" by pinging it
# The check must result in a 100% packet loss or 5 second (5000ms) round trip
# average time to produce a critical error.
# Note: Only one ICMP echo packet is sent (determined by the '-p 1' argument)
# 'check-host-alive' command definition
define command{
command_name check-host-alive
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 2 -t 6
# command_line $USER1$/check_updown.pl -H $HOSTADDRESS$
}
# 'check-host-updown' command definition
define command{
command_name check-host-updown
command_line $USER1$/check_updown.pl -H $HOSTADDRESS$
}
# 'check_nil' command definition
define command{
command_name check_nil
command_line $USER1$/check_nil.pl
}
# 'check_dummy' command definition
define command{
command_name check_dummy
command_line $USER1$/check_dummy $ARG1$
}
# 'check_ifoperstatus' command definition
define command{
command_name check_ifoperstatus
command_line $USER1$/check_ifoperstatus -H $HOSTADDRESS$ $ARG1$
}
# 'check_log' command definition
define command{
command_name check_log
command_line $USER1$/check_log -F $ARG1$ -O $ARG2$ -q $ARG3$
}
# 'check_log2' command definition
define command{
command_name check_log2
command_line $USER1$/check_log2 -l $ARG1$ -s $ARG2$ -p $ARG3$
}
# 'check_logs' command definition
define command{
command_name check_logs
command_line $USER1$/check_logs.pl -l $ARG1$ -s $ARG2$ -p $ARG3$
}
# 'check_tcpsmtp' command definition: checks TCP port 25
define command{
command_name check_tcpsmtp
command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p 25
}
################################################################################
#
# WISP Broadband object config file for Nagios
#
################################################################################
################################################################################
#
# HOST TEMPLATES
#
################################################################################
# Generic host definition template
define host{
name generic-host ; Template name, referenced in other host definitions
notifications_enabled 1 ; Host notifications are enabled
event_handler_enabled 1 ; Host event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
# active_checks_enabled 0
# passive_checks_enabled 0
register 0 ; Don't register, just a template
}
# Dummy host definition template
define host{
name dummy-host
notifications_enabled 1 ; Host notifications are enabled
event_handler_enabled 1 ; Host event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
check_command check_nil
max_check_attempts 1
contact_groups nagios-admins
notification_interval 120
notification_period 24x7
notification_options n
# active_checks_enabled 0
# passive_checks_enabled 0
register 0 ; Just a template
}
# AP host definition template
define host{
name ap-host
notifications_enabled 1 ; Host notifications are enabled
event_handler_enabled 1 ; Host event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
check_command check-host-alive
max_check_attempts 2
contact_groups nagios-admins
notification_interval 120
notification_period 24x7
notification_options d,u,r
# active_checks_enabled 0
# passive_checks_enabled 0
register 0 ; Just a template
}
# CPE host definition template
define host{
name cpe-host
notifications_enabled 1 ; Host notifications are enabled
event_handler_enabled 1 ; Host event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
check_command check-host-alive
max_check_attempts 1
contact_groups nagios-admins
notification_interval 1440 ; 24 hours
notification_period 24x7
notification_options d,u,r
# active_checks_enabled 0
# passive_checks_enabled 0
register 0 ; Just a template
}
################################################################################
#
# HOST DEFINITIONS
#
# Internet: ISP router definition
define host{
use generic-host
host_name ISP_Router
alias ISP Edge Router
# address 195.72.164.155
address 195.72.163.164
parents Net_Cyclone
check_command check-host-alive
max_check_attempts 2
contact_groups nagios-admins
notification_interval 120
notification_period 24x7
notification_options d,r
}
# Internet: Nildram DNS server definition
define host{
use generic-host
host_name Community_DNS
alias Nildram DNS
address 195.72.171.39
parents ISP_Router
check_command check-host-alive
max_check_attempts 2
contact_groups nagios-admins
notification_interval 120
notification_period 24x7
notification_options d,r
}
# Network Hub host definition
define host{
use dummy-host
host_name Net_ICK1_Hub
alias Ickford1 Hub
parents NMS
}
# NMS host definition
define host{
use generic-host
host_name NMS
alias Network Manager PC (NMS)
address 10.0.0.2
check_command check-host-alive
max_check_attempts 1
contact_groups nagios-admins
notification_interval 120
notification_period 24x7
notification_options d,r
}
# UPS Management Card host definition
define host{
use generic-host
host_name Net_UPS4
alias Ickford1 UPS-4
address 10.0.0.46
parents Net_ICK1_Hub
check_command check-host-alive
max_check_attempts 1
contact_groups nagios-admins
notification_interval 120
notification_period 24x7
notification_options d,r
}
# UPS Management Card host definition
define host{
use generic-host
host_name Net_UPS5
alias Ickford bearcave UPS-5
address 10.0.0.44
parents CPE_Bruin
check_command check-host-alive
max_check_attempts 1
contact_groups nagios-admins
notification_interval 120
notification_period 24x7
notification_options d,r
register 0
}
# Gemini radio host definition
define host{
use generic-host
host_name Net_WRM-ICK2
alias Gemini-Slave
address 10.0.0.5
parents Net_ICK2-WRM
check_command check-host-alive
max_check_attempts 3
contact_groups nagios-admins
notification_interval 120
notification_period 24x7
notification_options d,u,r
}
# Gemini radio host definition
define host{
use generic-host
host_name Net_ICK2-WRM
alias Gemini-Master
address 10.0.0.4
parents Net_ICK2_Hub
check_command check-host-alive
max_check_attempts 3
contact_groups nagios-admins
notification_interval 120
notification_period 24x7
notification_options d,u,r
}
# Cyclone host definition
define host{
use generic-host
host_name Net_Cyclone
alias Cyclone C1000 Router
address 10.0.0.1
parents Net_ICK1_Hub
check_command check-host-alive
max_check_attempts 3
contact_groups nagios-admins
notification_interval 60
notification_period 24x7
notification_options d,u,r
}
# Trango radio host definition
define host{
use generic-host
host_name Net_WRM-WRN
alias Trango-Master
address 10.0.0.6
parents Net_ICK1_Hub
check_command check-host-alive
max_check_attempts 3
contact_groups nagios-admins
notification_interval 120
notification_period 24x7
notification_options d,u,r
}
# Trango radio host definition
define host{
use generic-host
host_name Net_WRN-WRM
alias Trango-Slave
address 10.0.0.7
parents Net_WRM-WRN
# check_command check-host-alive
check_command check_nil
max_check_attempts 3
contact_groups nagios-admins
notification_interval 120
notification_period 24x7
notification_options d,u,r
}
# Ad-hoc ICMP device host definition
define host{
use generic-host
host_name Net_ICK2_Power
alias Ickford 2 Site Power Monitor
address 10.0.0.45
parents Net_ICK2_Hub
check_command check-host-alive
max_check_attempts 2
contact_groups nagios-admins
notification_interval 60
notification_period 24x7
notification_options d,r
}
# Ad-hoc ICMP device host definition
define host{
use generic-host
host_name Net_WRN_Power
alias Wornal Site Power Monitor
address 10.0.0.40
parents Net_WRN_Hub
check_command check-host-alive
max_check_attempts 2
contact_groups nagios-admins
notification_interval 60
notification_period 24x7
notification_options d,r
register 0
}
###########################################################################
#
# AP DEFINITIONS
#
###########################################################################
#
# Network Hub host definition
define host{
use dummy-host
host_name Net_ICK2_Hub
alias ICK2 Hub
parents APIckford2
}
# AP host definition
define host{
use ap-host
host_name APIckford2
alias Ickford #2
address 10.0.0.14
parents Ant_ICK1-ICK2
}
# APIckford2 Antenna host definition
define host{
use dummy-host
host_name Ant_ICK2-ICK1
alias ICK2-ICK1
address 10.0.0.14
parents APIckford2
}
###########################################################################
#
# AP host definition
define host{
use generic-host
host_name Net_ICK1-ICK2
alias ICK1-ICK2
address 10.0.0.9
parents APIckford2
check_command check-host-alive
max_check_attempts 2
contact_groups nagios-admins
notification_interval 120
notification_period 24x7
notification_options d,u,r
register 0
}
###########################################################################
#
# AP host definition
define host{
use ap-host
host_name APIckford1
alias Ickford #1
address 10.0.0.13
parents Net_ICK1_Hub
}
# APIckford1 Antenna host definition
define host{
use dummy-host
host_name Ant_ICK1-AP
alias ICK2-AP
address 10.0.0.13
parents APIckford1
}
# APIckford1 Antenna host definition
define host{
use dummy-host
host_name Ant_ICK1-ICK2
alias ICK1-ICK2
address 10.0.0.13
parents APIckford1
}
###########################################################################
#
# CPE DEFINITIONS
#
# CPE host definition
define host{
use cpe-host
host_name CPE_xxxx
alias (redacted)
address 10.0.0.50
parents Ant_ICK1-AP
}
###########################################################################
There's a bug somewhere in here to do with the difference between hosts and services but it was never annoying enough to track down.
You will see it formats the nagios alert and then adds some log entries and then creates an RSS entry for the alarm feed.
Example misccommands.cfg:
# 'email' command definition
define command{
command_name email
command_line /usr/local/nagios/bin/nagiosnotify.pl -h "$HOSTNAME$" -m "$CONTACTEMAIL$" -n "$CONTACTNAME$" -a "$HOSTADDRESS$" -t $NOTIFICATIONTYPE$ -h $HOSTNAME$ -o "$HOSTOUTPUT$" -d "$SERVICEDESC$" -s "$HOSTSTATE$" -w "$LONGDATETIME$"
}
Perl code:
#!/usr/bin/perl -w
use strict;
use Getopt::Long;
use Mail::Sendmail;
use XML::RSS;
=head1 SYNOPSIS
nagiosnotify.pl -h $HOSTNAME$ -m "$CONTACTEMAIL$" -n "$CONTACTNAME$" -a $HOSTADDRESS$ //
-t "$NOTIFICATIONTYPE$" -h "$HOSTNAME$" -o $HOSTOUTPUT$ //
-d "$SERVICEDESC$" -s $HOSTSTATE$ -w $LONGDATETIME$
=head1 DESCRIPTION
Nagios notify script. Uses SENDMAIL to send an e-mail and the
RSS library to add an item to the RSS feed.
=head1 AUTHOR
Nigel Bruin 2006
=cut
###############################################################################
#
# Constants & variables
# Fixed TO: and FROM: e-mail addresses
my $to = 'WISP Network ';
my $from = 'Nagios Server ';
# Path to external command "tail"
my $cmd_tail = '/usr/bin/tail';
# Filenames for logs files
my $fn_syslogs = '/var/log/system.log';
my $fn_nagioslog = '/usr/local/nagios/var/nagios.log';
# Filename for RSS feed
my $fn_rss = '/Library/WebServer/rss/nagios.rdf';
my $size_rss = 30;
# Link to NMS
my $urlNMSint = 'http://10.0.0.2/cgi-bin/nms.cgi';
#my $urlNMSext = 'http://84.12.108.100/cgi-bin/nms.cgi';
my $urlNMSext = 'http://195.72.186.183/cgi-bin/nms.cgi';
my $urlRSS = 'http://10.0.0.2/rss/nagios.rdf';
my $sep = '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -';
my ($hostname, $hostaddress, $datetime, $contactemail, $notificationtype,
$servicedesc, $servicestate, $servicecomment, $serviceoutput );
###############################################################################
#
# Main routine
# notify -m "$CONTACTEMAIL$" -p "$CONTACTPAGER$" -u "$CONTACTNAME$" -t "$NOTIFICATIONTYPE$" HOSTNAME="$HOSTNAME$" SERVICEDESC="$SERVICEDESC$"
GetOptions("h=s" => \$hostname,
"a=s" => \$hostaddress,
"w=s" => \$datetime,
"m=s" => \$contactemail,
"t=s" => \$notificationtype,
"d=s" => \$servicedesc,
"s=s" => \$servicestate,
"c=s" => \$servicecomment,
"o=s" => \$serviceoutput,
);
# Enforce suitable parameter defaults to avoid script crashes
if(!$hostname ) { $hostname = '?' };
if(!$hostaddress ) { $hostaddress = '?' };
if(!$datetime ) { $datetime = '?' };
if(!$contactemail ) { $contactemail = '?' };
if(!$notificationtype) { $notificationtype = '?' };
if(!$servicedesc ) { $servicedesc = '' };
if(!$servicestate ) { $servicestate = 'n/a' };
if(!$servicecomment ) { $servicecomment = 'n/a' };
if(!$serviceoutput ) { $serviceoutput = 'n/a' };
###############################################################################
#
# Wisp Broadband Nagios notification script.
#
#### Form up Body Text
# Nagios event details
my $problemdesc = "$datetime | Notification Type: $notificationtype\n\n";
if ($servicedesc ne '')
{ $problemdesc .= "Service: $servicedesc | " };
$problemdesc .= "Host: $hostname | IP Address: $hostaddress | State: $servicestate\n\n";
my $body = $problemdesc;
if ($notificationtype eq 'ACKNOWLEDGEMENT')
{ $body .= "Comment: $servicecomment\n\n" }
else
{ $body .= "Output: $serviceoutput\n\n" };
# Useful links
$body .= "NMS (int): $urlNMSint\nNMS: (ext): $urlNMSext\nRSS: $urlRSS\n$sep\n";
# System logs
my $syslogs = `$cmd_tail -n 10 $fn_syslogs`;
$body .= "Last few System logs:\n\n$syslogs\n";
# Nagios logs
my $nagioslogs = `$cmd_tail -n 10 $fn_nagioslog`;
# Convert log timestamps from UTC to a readbable format
# e.g.: [Sat Dec 31 10:00:48 2005]
$nagioslogs =~ s/\[(\d+)\]/"[".localtime($1)."]"/eg;
# Use this to delete just the year:
#$nagioslogs =~ s/\[(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)]/$1 $2 $3 $4/g;
#Use this to delete day, date and year, leaving just the time:
$nagioslogs =~ s/\[(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)]/$4/g;
$body .= "$sep\nLast few Nagios logs:\n\n$nagioslogs\n$sep\n";
$body .= "$0\nNigel Bruin 2006\n";
#### Form up Subject:
my $subject = "$notificationtype alert: $hostname";
if ($servicedesc ne '')
{ $subject .= '('.$servicedesc.')' };
$subject .= ' is '.$servicestate;
###############################################################################
# Send e-mail
my %mail = ( To => $to,
From => $from,
Subject => 'WISP Alarm: '.$subject,
Message => $body
);
sendmail(%mail);
###############################################################################
# Write a new item to the RSS feed
my $rss = new XML::RSS (version => '0.91',
encoding => 'ISO-8859-1'
);
$rss->parsefile($fn_rss);
pop(@{$rss->{'items'}}) if (@{$rss->{'items'}} == $size_rss);
$rss->add_item(title => $subject,
link => $urlNMSint,
mode => 'insert',
description => $problemdesc
);
$rss->save($fn_rss);
exit;
Broadband Buyer
Antennas: HyperLink Tech
Cat5e external: Homestead
Hot Wireless
Networking equip: Insight
Misc electrical: Maplin
Patch cables: MK Cables
Antenna, feeder cables: MS Distribution
Trango backhaul: Now Wireless
Orthogon
Gemini backhaul: ACAL
Misc electrical: Radio Spares
Wireless equip: Solwise
Antenna: Stella Doradus
Avaya AP: Westcon
Radios, antennas: Wireless CNP
Feeder cables: Wireless LAN Source
Rules-of-thumb:
• lose about half a dB for each connector
• lose half a dB for every ten feet of LMR-400 coax.
Times Microwave LMR Coax:
• LMR-400 Loss: 6.8dB/100 ft. - cable outside diameter=3/8"
• LMR-240 Loss: 12.9dB/100 ft. - cable outside diameter=1/4"
• LMR-200 Loss: 16.9dB/100 ft. - cable outside diameter=3/16"
Surge Suppression Ethernet:
APC: Inline: ProtectNet 100BT/10BT/TR
Rack mount: ProtectNet, e.g. PNETR5 990-1383A
HyperLink Tech, e.g. HGLN-CAT5
Motorola Canopy 300SS
Andrew: 223158
IEC male, right angle: Radio Spares 449-938