File: cisco_nat_packets.inc.php

package info (click to toggle)
jffnms 0.8.3dfsg.1-2.1etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 4,928 kB
  • ctags: 5,050
  • sloc: php: 19,981; sh: 266; makefile: 91; perl: 52
file content (73 lines) | stat: -rw-r--r-- 2,728 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?
/* Cisco NAT Packets. This file is part of JFFNMS.
 * Copyright (C) <2005> Javier Szyszlican <javier@szysz.com>
 * This program is licensed under the GNU GPL, full terms in the LICENSE file
 */

function graph_cisco_nat_packets ($data) { 

    $result = array_merge(
	rrdtool_get_def($data, array(
	    "icmp_in"    => "cisco_nat_icmp_inbound", 
	    "tcp_in"     => "cisco_nat_tcp_inbound",
	    "udp_in"     => "cisco_nat_udp_inbound",
	    "other_in"   => "cisco_nat_other_ip_inbound",
	    "_icmp_out"  => "cisco_nat_icmp_outbound",
	    "_tcp_out"   => "cisco_nat_tcp_outbound",
    	    "_udp_out"   => "cisco_nat_udp_outbound",
	    "_other_out" => "cisco_nat_other_ip_outbound"
	)),array(

	"CDEF:icmp_out=_icmp_out,-1,*",
	"CDEF:tcp_out=_tcp_out,-1,*",
	"CDEF:udp_out=_udp_out,-1,*",
	"CDEF:other_out=_other_out,-1,*",
	
         
        "LINE2:icmp_in#8D00BA:'+ Inbound  ICMP '", 
        "GPRINT:icmp_in:MAX:'Max\: %8.2lf %spps'", 
        "GPRINT:icmp_in:AVERAGE:'Average\:%8.2lf %spps'",
        "GPRINT:icmp_in:LAST:'Last\:%8.2lf %spps \\n'",

        "LINE2:tcp_in#00CC00:'+ Inbound  TCP  '", 
        "GPRINT:tcp_in:MAX:'Max\: %8.2lf %spps'", 
        "GPRINT:tcp_in:AVERAGE:'Average\:%8.2lf %spps'",
        "GPRINT:tcp_in:LAST:'Last\:%8.2lf %spps\\n'",

        "LINE2:udp_in#FF0000:'+ Inbound  UDP  '", 
        "GPRINT:udp_in:MAX:'Max\: %8.2lf %spps'", 
        "GPRINT:udp_in:AVERAGE:'Average\:%8.2lf %spps'",
        "GPRINT:udp_in:LAST:'Last\:%8.2lf %spps \\n'",

        "LINE2:other_in#0090F0:'+ Inbound  Other'", 
        "GPRINT:other_in:MAX:'Max\: %8.2lf %spps'", 
        "GPRINT:other_in:AVERAGE:'Average\:%8.2lf %spps'",
        "GPRINT:other_in:LAST:'Last\:%8.2lf %spps \\n'",
	
	"LINE2:icmp_out#8D00BA:'- Outbound ICMP '", 
        "GPRINT:_icmp_out:MAX:'Max\: %8.2lf %spps'", 
        "GPRINT:_icmp_out:AVERAGE:'Average\:%8.2lf %spps'",
        "GPRINT:_icmp_out:LAST:'Last\:%8.2lf %spps \\n'",

        "LINE2:tcp_out#00CC00:'- Outbound TCP  '", 
        "GPRINT:_tcp_out:MAX:'Max\: %8.2lf %spps'", 
        "GPRINT:_tcp_out:AVERAGE:'Average\:%8.2lf %spps'",
        "GPRINT:_tcp_out:LAST:'Last\:%8.2lf %spps\\n'",

        "LINE2:udp_out#FF0000:'- Outbound UDP  '", 
        "GPRINT:_udp_out:MAX:'Max\: %8.2lf %spps'", 
        "GPRINT:_udp_out:AVERAGE:'Average\:%8.2lf %spps'",
        "GPRINT:_udp_out:LAST:'Last\:%8.2lf %spps \\n'",

        "LINE2:other_out#0090F0:'- Outbound Other'", 
        "GPRINT:_other_out:MAX:'Max\: %8.2lf %spps'", 
        "GPRINT:_other_out:AVERAGE:'Average\:%8.2lf %spps'",
        "GPRINT:_other_out:LAST:'Last\:%8.2lf %spps \\n'"
	
    )); 

    $opts_header[] = "--vertical-label='Packets per Second'"; 

    return array ($opts_header, $result);
}
?>