Projet

Général

Profil

Révision 440ebfe6

ID440ebfe69b0f58b3ed5c7095d9f234dec865cdaa
Parent f22b8c6c
Enfant 8c5a7b2f

Ajouté par Thomas Diener il y a plus de 13 ans

Plugin updated to work with Fortinet Fortigate Firmware v4.00MR3Patch6

Voir les différences:

plugins/system/snmp__fn/snmp__fn
2 2
#
3 3
# File:        snmp__fn
4 4
# Description: SNMP plugin to monitor open sessions, sslvpn, CPU and Memory on a
5
#              Fortigate firewall.
5
#              Fortinet Fortigate firewall.
6 6
# 
7 7
# Author:      Thom Diener <munin@tmd.ch>
8 8
# License:     This program is free software; you can redistribute it and/or
......
13 13
# Version:     v1.00 30.10.2011 First draft of the fortigate plugin
14 14
#              v1.01 19.01.2012 OID to MIB changed, plugins gets faster
15 15
#              v1.02 25.01.2012 MIB file availability check added
16
#              v1.03 01.04.2012 Update to work with Firmware v4.00MR3Patch6
16 17
#
17 18
# Parameters:  config   (required)
18 19
#              autoconf (optional)
......
21 22
#              (Example: ln -s /usr/share/munin/plugins/snmp__fn \
22 23
#              /etc/munin/plugins/snmp_foo.example.com_fn)
23 24
#
24
#              Global community string /etc/munin/plugin-conf.d/munin-node
25
#                [snmp_*]
26
#                env.community private
27
#                timeout 45   # In case low latency or timeout
25
#              Add global community string 
26
#              vi /etc/munin/plugin-conf.d/munin-node
27
#              [snmp_*]
28
#              env.community private
29
#              timeout 45   # In case low latency or timeout
28 30
#
29
# Fortigate    Activate snmp on your Fortigate firewall. Fortigate documentation
30
#              at  https://support.fortinet.com 
31
# Fortigate    Activate snmp on your Fortigate firewall. 
32
#              Fortigate documentation at https://support.fortinet.com 
31 33
#
32
# MIB          Download and copy the original Fortigate MIB defintion file to 
33
#              /usr/share/snmp/mibs/FORTINET-300-MIB.txt (Filename depends on
34
#              used Version)
34
# MIB          Download and copy the original Fortigate MIB defintion files to:
35
#              /usr/share/snmp/mibs/FORTINET-CORE-MIB.mib.txt
36
#              /usr/share/snmp/mibs/FORTINET-FORTIGATE-MIB.mib
35 37
#
36
# Tested with Fortinet Fortigate-50B, Firmware 3.00(MR6) on Ubuntu 10.04 LTS
37
# with Munin 1.4.4 installed.
38
# Testeding    The plugin ist testet with the following OS/Software:
39
#              
40
#              Appliance/Firmware:
41
#              Fortigate-50B 3.00-b0662(MR6 Patch 1)  work with v1.00-1.02
42
#              Fortigate-50B 3.00-b0678(MR6 Patch 6)  work with v1.00-1.02
43
#              Fortigate-50B 4.00-b0178(MR1 Patch 1)  work with v1.00-1.02
44
#              Fortigate-50B 4.00-b0217(MR1 Patch 10) work with v1.00-1.02
45
#              Fortigate-50B 4.00-b0217(MR2 Patch 4)  work with v1.00-1.02
46
#              Fortigate-50B 4.00-b0521(MR3 Patch 6)  work with v1.03
47
#              
48
#              Munin-Version:
49
#              Munin 1.4.4 (1.4.4-1ubuntu1) 
50
#              OS-Version:    
51
#              Ubuntu 10.04.3 LTS (lucid) x86_32/64
38 52
#
39 53
#%# family=manual
40 54
#
41

  
42

  
43 55
#set -x
44 56

  
45 57
### Constants ------------------------------------------------------------------
46 58
SNMPCLIENT=`basename $0 | sed 's/^snmp_//g' | cut -d "_" -f1`
47
MIBFILE="/usr/share/snmp/mibs/FORTINET-300-MIB.20080414.txt"
59
MIBFILE="/usr/share/snmp/mibs/FORTINET-FORTIGATE-MIB.mib"
48 60
FNTYPE=`echo $MIBFILE | cut -d "." -f1 | cut -d "/" -f6`
49 61
if [ -r $MIBFILE ]; then
50 62
 SNMPGET="/usr/bin/snmpget -m $MIBFILE  -c $community -v 2c $SNMPCLIENT"
51 63
else
52
 echo no, MIB definition file not available or readable.
64
 echo Nok! MIB definition file not available or readable.
53 65
 exit 1
54 66
fi
67
UNIT="Fortinet Fortigate Unit"
68

  
55 69

  
56 70
### Variables ------------------------------------------------------------------
57
fnSysVersion="1.3.6.1.4.1.12356.1.3.0"
58
FGTcpu="$FNTYPE::fnSysCpuUsage.0"
59
fnSysVersion="$FNTYPE::fnSysVersion.0"
60
fnSysMemUsage="$FNTYPE::fnSysMemUsage.0"
61
fnSysSesCount="$FNTYPE::fnSysSesCount.0"
62
fnVPNSslStatsLoginUsers="$FNTYPE::fnVpnSslStatsLoginUsers.1"
63
fnVPNSslStatsActiveWebSessions="$FNTYPE::fnVpnSslStatsActiveWebSessions.1"
64
fnVPNSslStatsActiveTunnels="$FNTYPE::fnVpnSslStatsActiveTunnels.1"
71
FGTcpu="$FNTYPE::fgSysCpuUsage.0"
72
fnSysMemUsage="$FNTYPE::fgSysMemUsage.0"
73
fnSysSesCount="$FNTYPE::fgSysSesCount.0"
74
fnVPNSslStatsLoginUsers="$FNTYPE::fgVpnSslStatsLoginUsers.1"
75
fnVPNSslStatsActiveWebSessions="$FNTYPE::fgVpnSslStatsActiveWebSessions.1"
76
fnVPNSslStatsActiveTunnels="$FNTYPE::fgVpnSslStatsActiveTunnels.1"
65 77

  
66
UNIT=`$SNMPGET $fnSysVersion  | cut -d ":" -f4 | cut -d " " -f2 | cut -d "\"" -f2`
67 78
SCPU=`$SNMPGET $FGTcpu        | cut -d ":" -f4 | cut -d " " -f2`
68 79
SMEM=`$SNMPGET $fnSysMemUsage | cut -d ":" -f4 | cut -d " " -f2`
69 80
SCNT=`$SNMPGET $fnSysSesCount | cut -d ":" -f4 | cut -d " " -f2`

Formats disponibles : Unified diff