# File: /etc/map # Desc: Nagiosgraph map file, perl rules to extract graph data from Nagios # host and performance data sent to /log/ # Last: 20100303 support@frank4dd.com ############################################################################### # INSTRUCTIONS: # # # # This file contains several examples of service types. Edit this file to # # add more service types. The data string from Nagios is in $_ . Use # # regular expressions to identify and extract data like the examples below # # below. Match on either output: or perfdata: . The code is pure perl, # # that will be run inside an eval{}. Results are expected in @s. The general # # format is: # # # # /output|perfdata: = .../ # # and push @s, [ , # # [ , GAUGE|DERIVE, ], # # [ , GAUGE|DERIVE, ], # # [ . . . ], # # [ . . . ] ]; # # # # More advanced code is possible, as long as the resulting data structure is # # correct. # ############################################################################### # 01 ------------------------------------------------------------------------ # # Data to graph: RoundTrip Time measured by Ping # # Service type: check-host-alive (ping) # # Nagios plugin: check_ping # # Nagios output: ||PING OK - Packet loss = 0%, RTA = 1.84 ms # # --------------------------------------------------------------------------- # /output:PING.*?(\d+)%.+?([.\d]+)\sms/ and push @s, [ ping, [ losspct, GAUGE, $1 ], [ rta, GAUGE, $2/1000 ] ]; # 02 ------------------------------------------------------------------------ # # Data to graph: Cisco Router CPU load # # Service type: load-check # # Nagios plugin: check_snmp_load.pl # # Nagios output: ||CPU : 3 4 3 : OK|| # # --------------------------------------------------------------------------- # /output:CPU : (\d+) (\d+) (\d+) : / and push @s, [ cpu, [ avg1min, GAUGE, $1 ], [ avg5min, GAUGE, $2 ], [ avg15min, GAUGE, $3 ] ]; # 03 ------------------------------------------------------------------------ # # Data to graph: Linux CPU load # # Service type: load-check # # Nagios plugin: check_snmp_load.pl # # Nagios output: ||Load : 0.48 0.62 0.40 : OK|| # # --------------------------------------------------------------------------- # /output:Load : (\d+\.\d+) (\d+\.\d+) (\d+\.\d+) : / and push @s, [ cpu, [ avg1min, GAUGE, $1 ], [ avg5min, GAUGE, $2 ], [ avg15min, GAUGE, $3 ] ]; # 04 ------------------------------------------------------------------------ # # Data to graph: Windows CPU load # # Service type: load-check # # Nagios plugin: check_snmp_load.pl # # Nagios output: ||4 CPU, average load 64.8% 65% : OK|| # # alternate out: ||1 CPU, load 7.0% 65% : OK|| # # --------------------------------------------------------------------------- # /output:(\d+ CPU),.*load (\d+\.\d+)\% ([0-9]+)\% : / and push @s, [ $1, [ avg1min, GAUGE, $2 ] ]; # 05 ------------------------------------------------------------------------ # # Data to graph: Netscreen session check # # Service type: session-check # # Nagios plugin: check_netscreen_session # # Nagios output: ||OK: host 192.168.85.254, sessions : 7/5024 (0.14%)|| # # --------------------------------------------------------------------------- # /output:.* sessions : (\d+)\/(\d+) \((\d+\.\d+)\%\)/ and push @s, [ sessions, [ current, GAUGE, $1 ], [ maximum, GAUGE, $2 ] ]; # 06 ------------------------------------------------------------------------ # # Data to graph: Netscreen memory check # # Service type: check_snmp_mem_netscreen # # Nagios plugin: check_netscreen_mem # # Nagios output: ||OK: host 192.168.85.254, Memory: Allocated:(18.60) \ # # Free:(90.40) Percent Used:(17.07%)|| # # --------------------------------------------------------------------------- # /output:.* Memory: Allocated:\((\d+\.\d+)\) Free:\((\d+\.\d+)\) Percent Used:\((\d+\.\d+)\%\)/ and push @s, [ memory, [ alloc, GAUGE, $1 ], [ free, GAUGE, $2 ], [ used, GAUGE, $3 ] ]; # 07 ------------------------------------------------------------------------ # # Data to graph: Cisco memory check # # Service type: memory-check # # Nagios plugin: check_snmp_mem.pl # # Nagios output: ||Processor:50%,I/O:21% : 44% : : OK|| # # ||Processor:87%,I/O:21% : 72% : > 80 : WARNING|| # # IOS 12.2(35)SE5: # # ||Driver text:0%,Processor:17%,I/O:39% : 18% : : OK|| # # --------------------------------------------------------------------------- # /output:.*Processor:(\d+)\%,I\/O:(\d+)\% : (\d+)\% :/ and push @s, [ memory, [ cpu, GAUGE, $1 ], [ io, GAUGE, $2 ], [ all, GAUGE, $3 ] ]; # 08 ------------------------------------------------------------------------ # # Data to graph: Linux memory check # # Service type: memory-check # # Nagios plugin: check_snmp_mem.pl # # Nagios output: ||Ram : 67%, Swap : 38% : : OK|| # # --------------------------------------------------------------------------- # /output:Ram : (\d+)\%, Swap : (\d+)\%/ and push @s, [ memory, [ ram, GAUGE, $1 ], [ swap, GAUGE, $2 ] ]; # 09 ------------------------------------------------------------------------ # # Data to graph: Cisco ASA firewall memory check # # Service type: memory-check # # Nagios plugin: check_snmp_mem.pl # # Nagios output: ||System memory:41% : 41% : : OK|| # # --------------------------------------------------------------------------- # /output:System memory:(\d+)\% :/ and push @s, [ memory, [ system, GAUGE, $1 ] ]; # 10 ------------------------------------------------------------------------ # # Data to graph: Windows memory check (Physical and Virtual) # # Service type: check-snmp-pmem and check-snmp-vmem # # Nagios plugin: check_snmp_storage # # Nagios output: ||OK : Physical Memory: 39%used(401MB/1023MB) : 80 %|| # # --------------------------------------------------------------------------- # /output:.* : (\S+ Memory): (\d+)\%/ and push @s, [ $1, [ pctused, GAUGE, $2 ] ]; # 11 ------------------------------------------------------------------------ # # Data to graph: Windows SMB file share storage # # Service type: check_disk_smb_dfs # # Nagios plugin: check_disk_smb # # Nagios output: ||Disk ok - 4.18G (42%) free on \\192.168.100.22\DFS|| # # Nagios output: ||CRITICAL: Only 33.87G (2%) free on \\192.168.100.231\fs01|| # # --------------------------------------------------------------------------- # /output:.* (\d+\.\d+). \((\d+)\%\) free on \\\\(\S+)/ and push @s, [ $3, [ pctfree, GAUGE, $2 ] ]; # 12 ------------------------------------------------------------------------ # # Data to graph: Single Partition (AIX, Linux) # # Service type: storage-check-unix # # Nagios plugin: check_snmp_storage # # Nagios ouput: ||OK : /dev/hd10opt: 71%used(457MB/640MB) : 90 %|| # # Use perfdata: /dev/hd10opt=457MB;576;608;0;640 # # --------------------------------------------------------------------------- # /output:.* : (\S+): (\d+)\%used\((\d+).B\/(\d+).B\) : (\d+) \%/ and push @s, [ "$1", [ pctused, GAUGE, $2 ] ]; # 13 ------------------------------------------------------------------------ # # Data to graph: SNMP storage check Windows C:\ # # Service type: check_snmp_storage # # Nagios plugin: check_snmp_storage # # Nagios output: ||OK : C:\ Label: Serial Number 18d2a1af: 65%used(13333MB/\ # # 20473MB) : < 70 % # # --------------------------------------------------------------------------- # /output:.* : (\S+):\\ Label:.*: (\d+)\%used\((\d+).B\/(\d+).B\) : (\d+) \%/ and push @s, [ "$1_drive", [ pctused, GAUGE, $2 ] ]; # 14 ------------------------------------------------------------------------ # # Data to graph: Check UNIX Procs # # Service type: unix-procs # # Nagios plugin: check_unix_procs # # Nagios output: PROCS OK: 43 processes # # --------------------------------------------------------------------------- # /output:PROCS.*?(\d+) processes\n/ and push @s, [ procs, [ procs, GAUGE, $1 ] ]; # 15 ------------------------------------------------------------------------ # # Data to graph: Check www access # # Service type: check_web # # Nagios plugin: check_http # # Nagios output: HTTP OK HTTP/1.1 200 OK - 1456 bytes in 0.003 seconds # # --------------------------------------------------------------------------- # /output:HTTP.*?(\d+) byte.*?([.0-9]+) sec/ and push @s, [ http, [ bps, GAUGE, $1/$2 ] ]; # 16 ------------------------------------------------------------------------ # # Data to graph: Check Apache sessions # # Service type: apache-load # # Nagios plugin: check_apachestatus.pl # # Nagios output: OK 0.038933 seconds response time. Idle 5, busy 3, \ # # open slots 142 # # Use perfdata: Waiting for Connection=5 Starting Up=0 Reading Request=0 \ # # Sending Reply=3 Keepalive (read)=0 DNS Lookup=0 Closing \ # # Connection=0 Logging=0 Gracefully finishing=0 Idle cleanup=0\# # Open slot=142 Requests/sec=0.0 B per sec=109.0B B per \ # # Request=4851.0B # # --------------------------------------------------------------------------- # /output:.*([0-9]+\.?[0-9]+).* response time. Idle (\d+), busy (\d+), open slots (\d+)/ and push @s, [ sessions, [ 'idle', GAUGE, $2 ], [ 'busy', GAUGE, $3 ], [ 'avail', GAUGE, $4 ], ]; # 17 ------------------------------------------------------------------------ # # Data to graph: Check tcp port access # # Service type: check-tcp-port # # Nagios plugin: check_tcp # # Nagios output: TCP OK - 0.061 second response time on port 22 # # Use perfdata: time=0.060777s;0.000000;0.000000;0.000000;10.000000 # # --------------------------------------------------------------------------- # /output:TCP.*?on port (\d+)\s*perfdata:time=(\d+\.\d+).*(\d+\.\d+)\D*(\d+\.\d+)\D*(\d+\.\d+)\D*(\d+\.\d+)/ and push @s, [ "tcp_$1", [ 'connect_time', GAUGE, $2 ], [ 'warning_time', GAUGE, $3 ], [ 'critical_time', GAUGE, $4 ], [ 'socket_timeout', GAUGE, $6 ], ]; # 18 ------------------------------------------------------------------------ # # Data to graph: HP Temperature Sensors # # Service type: temperature_ambient # # Nagios plugin: check_snmp_temperature # # Nagios output: ||OK - Ambient_1 Temperature is 24C # # --------------------------------------------------------------------------- # /output:.* - (\S+) Temperature is (\d+)C/ and push @s, [ $1, [ Celsius, GAUGE, $2 ] ]; # 19 ------------------------------------------------------------------------ # # Data to graph: Check Network Bandwidth # # Nagios plugin: check_bandwidth3 # # Nagios output: ||OK Out: 1.29Kbps: In: 3.61Kbps|| # # Nagios output: ||OK Bandwidth Out: 458.41bps: In: 2.89Kbps|| # # Use perfdata: out=458.405063291139;2250000;2700000;0;3000000 \ # # in=2958.91139240506;2250000;2700000;0;3000000 # # --------------------------------------------------------------------------- # /perfdata:out=(\d+\.\d+);(\d+);(\d+);(\d+);(\d+) in=(\d+\.\d+)/ and push @s, [ bandwidth, [ 'out', GAUGE, $1 ], [ 'in', GAUGE, $6 ], [ 'sum', GAUGE, $1+$6 ], [ 'warn', GAUGE, $2 ], [ 'crit', GAUGE, $3 ], [ 'max', GAUGE, $5 ], ]; # 20 ------------------------------------------------------------------------ # # Data to graph: Check Application Sessions # # Nagios plugin: check_app_sessions.java # # Nagios output: ||OK - App session count Total: 4 # # Use perfdata: Clone1: 0 Clone2: 4 # # --------------------------------------------------------------------------- # /output:.* - WI session count Total: (\d+)/ and push @s, [ WebIllustrator, [ Sessions, GAUGE, $1 ] ]; # 21 ------------------------------------------------------------------------ # # Data to graph: Check NTP Clock # # Service type: check_ntp_clock # # Nagios plugin: check_ntp_time # # Nagios output: NTP OK: Offset -0.003089785576 secs # # Use perfdata: offset=-0.003090s;5.000000;10.000000; (offset, warn and crit)# # --------------------------------------------------------------------------- # /output:NTP.*Offset ([-.0-9]+) secs/ and push @s, [ ntp, [ offset, GAUGE, $1 ] ]; # 22 ------------------------------------------------------------------------ # # Data to graph: Check SMTP Mail service # # Service type: check-mail-gw # # Nagios plugin: check_smtp # # Nagios output: ||SMTP OK - 5.279 sec. response time # # Use perfdata: ||time=5.278750s;;;0.000000 # # --------------------------------------------------------------------------- # /output:SMTP.*?(\d+\.\d+) sec/ and push @s, [ smtp, [ response, GAUGE, $1 ] ]; # 23 ------------------------------------------------------------------------ # # Data to graph: Check Citrix Sessions # # Nagios plugin: check_ snmp_citrix # # Nagios output: ||USERS OK - 1 users currently logged in|| # # Use perfdata: User=1;;; # # --------------------------------------------------------------------------- # /output:.* - (\d+) users currently logged in/ and push @s, [ Citrix, [ Sessions, GAUGE, $1 ] ]; # 24 ------------------------------------------------------------------------ # # Data to graph: Check BlueCoat Proxy Load # # Nagios plugin: check_ snmp_load.pl # # Nagios output: ||CPU used 0.0% (85) : OK|| # # --------------------------------------------------------------------------- # /output:CPU used (\d+\.\d+)%/ and push @s, [ BlueCoat, [ Load, GAUGE, $1 ] ]; # 25 ------------------------------------------------------------------------ # # Data to graph: check_hp_enclosure power usage in Watt # # Nagios plugin: check_hp_bladechassis # # Nagios output: ||OK - System: BladeSystem c7000 Enclosure G2, SN: # # SGH018X9ES, Firmware: 3.00, hardware working fine, 4 blades, 2 i/o modules||# # Use perfdata: total_watt=1266W;0;0 # # --------------------------------------------------------------------------- # /perfdata:total_watt=(\d+)W/ and push @s, [ power, [ Watt, GAUGE, $1 ] ]; # 26 ------------------------------------------------------------------------ # # Data to graph: Lotus Notes user session count # # Nagios plugin: check_domino_sessions # # Nagios output: ||Lotus Notes user session count: OK - 14|| # # Use perfdata: NOTES-MIB::lnServerUsers.0=14 # # --------------------------------------------------------------------------- # #/perfdata:NOTES\-MIB::lnServerUsers\.0=(\d+)/ /output:Lotus Notes user session count: .* - (\d+)/ and push @s, [ Notes, [ sessions, GAUGE, $1 ] ]; # 27 ------------------------------------------------------------------------ # # Data to graph: Check LDAP Authentication # # Nagios plugin: check_ldap # # Nagios output: ||LDAP OK - 0.030 seconds response time|| # # Use perfdata: time=0.030093s;;;0.000000 # # --------------------------------------------------------------------------- # /output:LDAP .* - (\d+\.\d+) seconds response time/ and push @s, [ ldap, [ response, GAUGE, $1 ] ]; # 28 ------------------------------------------------------------------------ # # Data to graph: Check CPU usage on Avaya S8xxx media servers # # Nagios plugin: check_avaya_load # # Nagios output: ||Avaya CPU: 3% used, 97% free : OK|| # # --------------------------------------------------------------------------- # /output:Avaya CPU: (\d+)%/ and push @s, [ Avaya, [ CPU, GAUGE, $1 ] ]; # 29 ------------------------------------------------------------------------ # # Data to graph: Check trunk group utilization on Avaya S8xxx media servers # # Nagios plugin: check_avaya_trunks # # Nagios output: ||Avaya Trunk TGN 1 - 0 of 46 channels active: OK|| # # --------------------------------------------------------------------------- # /output:Avaya Trunk TGN (\d+) - (\d+) of (\d+) channels/ and push @s, [ Avaya, [ 'TGN_'.$1.'_calls', GAUGE, $2 ], [ 'TGN_'.$1.'_channels', GAUGE, $3 ] ]; # 30 ------------------------------------------------------------------------ # # Data to graph: summary of all open files # # Nagios plugin: check_open_files.pl -w 80 -c 90 # # Nagios output: ||OK: open files (2016) is below threshold (160000/180000) # # Use perfdata: |open_files=2016;160000;180000 # # --------------------------------------------------------------------------- # /output:.*: open files \((\d+)\) is below threshold .*/ and push @s, [ 'all_open_files', [ 'open_files', GAUGE, $1 ] ]; # 31 ------------------------------------------------------------------------ # # Data to graph: summary of all open files per process # # Nagios plugin: check_unix_fds.pl -a /srv/app/nagios/bin/nagios -w 50,80 # # Nagios output: ||UNIX_OPEN_FDS OK - nagios handling 44 files # # Use perfdata: |open_files=2016;160000;180000 # # --------------------------------------------------------------------------- # /output:UNIX_OPEN_FDS .* - (\S+) handling (\d+) files/ and push @s, [ "$1_open_files", [ 'open_files', GAUGE, $2 ] ]; #1433755358||f4dhkf55201||session-check||OK: 7 Cisco ASA webvpn sessions|| # 32 ------------------------------------------------------------------------ # # Data to graph: Check ASA webvpn Sessions # # Nagios plugin: check_asa_sessions.pl # # Nagios output: ||OK: 7 Cisco ASA webvpn sessions|| # # --------------------------------------------------------------------------- # /output:.*: (\d+) Cisco ASA webvpn sessions/ and push @s, [ 'Web-VPN', [ 'Sessions', GAUGE, $1 ] ]; #1433755358||f4dhkf55201||session-check||OK: 7 Cisco ASA sslvpn sessions|| # 33 ------------------------------------------------------------------------ # # Data to graph: Check ASA sslvpn Sessions # # Nagios plugin: check_asa_sessions.pl # # Nagios output: ||OK: 16 Cisco ASA sslvpn sessions|| # # --------------------------------------------------------------------------- # /output:.*: (\d+) Cisco ASA sslvpn sessions/ and push @s, [ 'SSL-VPN', [ 'Sessions', GAUGE, $1 ] ]; # 34 ------------------------------------------------------------------------ # # Data to graph: Check ASA ipsec Sessions # # Nagios plugin: check_asa_sessions.pl # # Nagios output: ||OK: 16 Cisco ASA ipsec sessions|| # # --------------------------------------------------------------------------- # /output:.*: (\d+) Cisco ASA ipsec sessions/ and push @s, [ 'IPsec', [ 'Sessions', GAUGE, $1 ] ]; # 35 ------------------------------------------------------------------------ # # Data to graph: Check ASA sslvpn Sessions # # Nagios plugin: check_asa_sessions.pl # # Nagios output: ||OK: 37 Cisco ASA rasvpn sessions|| # # --------------------------------------------------------------------------- # /output:.*: (\d+) Cisco ASA rasvpn sessions/ and push @s, [ 'Total_VPN', [ 'Sessions', GAUGE, $1 ] ];