mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-25 18:38:30 +00:00
Merge pull request #75 from quade0/master
Plugin updated to work with Fortinet Fortigate Firmware v4.00MR3Patch6
This commit is contained in:
commit
79959fb3c2
1 changed files with 36 additions and 25 deletions
|
@ -2,7 +2,7 @@
|
||||||
#
|
#
|
||||||
# File: snmp__fn
|
# File: snmp__fn
|
||||||
# Description: SNMP plugin to monitor open sessions, sslvpn, CPU and Memory on a
|
# Description: SNMP plugin to monitor open sessions, sslvpn, CPU and Memory on a
|
||||||
# Fortigate firewall.
|
# Fortinet Fortigate firewall.
|
||||||
#
|
#
|
||||||
# Author: Thom Diener <munin@tmd.ch>
|
# Author: Thom Diener <munin@tmd.ch>
|
||||||
# License: This program is free software; you can redistribute it and/or
|
# License: This program is free software; you can redistribute it and/or
|
||||||
|
@ -13,6 +13,7 @@
|
||||||
# Version: v1.00 30.10.2011 First draft of the fortigate plugin
|
# Version: v1.00 30.10.2011 First draft of the fortigate plugin
|
||||||
# v1.01 19.01.2012 OID to MIB changed, plugins gets faster
|
# v1.01 19.01.2012 OID to MIB changed, plugins gets faster
|
||||||
# v1.02 25.01.2012 MIB file availability check added
|
# v1.02 25.01.2012 MIB file availability check added
|
||||||
|
# v1.03 01.04.2012 Update to work with Firmware v4.00MR3Patch6
|
||||||
#
|
#
|
||||||
# Parameters: config (required)
|
# Parameters: config (required)
|
||||||
# autoconf (optional)
|
# autoconf (optional)
|
||||||
|
@ -21,49 +22,59 @@
|
||||||
# (Example: ln -s /usr/share/munin/plugins/snmp__fn \
|
# (Example: ln -s /usr/share/munin/plugins/snmp__fn \
|
||||||
# /etc/munin/plugins/snmp_foo.example.com_fn)
|
# /etc/munin/plugins/snmp_foo.example.com_fn)
|
||||||
#
|
#
|
||||||
# Global community string /etc/munin/plugin-conf.d/munin-node
|
# Add global community string
|
||||||
# [snmp_*]
|
# vi /etc/munin/plugin-conf.d/munin-node
|
||||||
# env.community private
|
# [snmp_*]
|
||||||
# timeout 45 # In case low latency or timeout
|
# env.community private
|
||||||
|
# timeout 45 # In case low latency or timeout
|
||||||
#
|
#
|
||||||
# Fortigate Activate snmp on your Fortigate firewall. Fortigate documentation
|
# Fortigate Activate snmp on your Fortigate firewall.
|
||||||
# at https://support.fortinet.com
|
# Fortigate documentation at https://support.fortinet.com
|
||||||
#
|
#
|
||||||
# MIB Download and copy the original Fortigate MIB defintion file to
|
# MIB Download and copy the original Fortigate MIB defintion files to:
|
||||||
# /usr/share/snmp/mibs/FORTINET-300-MIB.txt (Filename depends on
|
# /usr/share/snmp/mibs/FORTINET-CORE-MIB.mib.txt
|
||||||
# used Version)
|
# /usr/share/snmp/mibs/FORTINET-FORTIGATE-MIB.mib
|
||||||
#
|
#
|
||||||
# Tested with Fortinet Fortigate-50B, Firmware 3.00(MR6) on Ubuntu 10.04 LTS
|
# Testing This plugin has been tested with the following OS/software:
|
||||||
# with Munin 1.4.4 installed.
|
#
|
||||||
|
# Appliance/Firmware:
|
||||||
|
# Fortigate-50B 3.00-b0662(MR6 Patch 1) work with v1.00-1.02
|
||||||
|
# Fortigate-50B 3.00-b0678(MR6 Patch 6) work with v1.00-1.02
|
||||||
|
# Fortigate-50B 4.00-b0178(MR1 Patch 1) work with v1.00-1.02
|
||||||
|
# Fortigate-50B 4.00-b0217(MR1 Patch 10) work with v1.00-1.02
|
||||||
|
# Fortigate-50B 4.00-b0217(MR2 Patch 4) work with v1.00-1.02
|
||||||
|
# Fortigate-50B 4.00-b0521(MR3 Patch 6) work with v1.03
|
||||||
|
#
|
||||||
|
# Munin-Version:
|
||||||
|
# Munin 1.4.4 (1.4.4-1ubuntu1)
|
||||||
|
# OS-Version:
|
||||||
|
# Ubuntu 10.04.3 LTS (lucid) x86_32/64
|
||||||
#
|
#
|
||||||
#%# family=manual
|
#%# family=manual
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
#set -x
|
#set -x
|
||||||
|
|
||||||
### Constants ------------------------------------------------------------------
|
### Constants ------------------------------------------------------------------
|
||||||
SNMPCLIENT=`basename $0 | sed 's/^snmp_//g' | cut -d "_" -f1`
|
SNMPCLIENT=`basename $0 | sed 's/^snmp_//g' | cut -d "_" -f1`
|
||||||
MIBFILE="/usr/share/snmp/mibs/FORTINET-300-MIB.20080414.txt"
|
MIBFILE="/usr/share/snmp/mibs/FORTINET-FORTIGATE-MIB.mib"
|
||||||
FNTYPE=`echo $MIBFILE | cut -d "." -f1 | cut -d "/" -f6`
|
FNTYPE=`echo $MIBFILE | cut -d "." -f1 | cut -d "/" -f6`
|
||||||
if [ -r $MIBFILE ]; then
|
if [ -r $MIBFILE ]; then
|
||||||
SNMPGET="/usr/bin/snmpget -m $MIBFILE -c $community -v 2c $SNMPCLIENT"
|
SNMPGET="/usr/bin/snmpget -m $MIBFILE -c $community -v 2c $SNMPCLIENT"
|
||||||
else
|
else
|
||||||
echo no, MIB definition file not available or readable.
|
echo No, MIB definition file not available or readable.
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
UNIT="Fortinet Fortigate Unit"
|
||||||
|
|
||||||
|
|
||||||
### Variables ------------------------------------------------------------------
|
### Variables ------------------------------------------------------------------
|
||||||
fnSysVersion="1.3.6.1.4.1.12356.1.3.0"
|
FGTcpu="$FNTYPE::fgSysCpuUsage.0"
|
||||||
FGTcpu="$FNTYPE::fnSysCpuUsage.0"
|
fnSysMemUsage="$FNTYPE::fgSysMemUsage.0"
|
||||||
fnSysVersion="$FNTYPE::fnSysVersion.0"
|
fnSysSesCount="$FNTYPE::fgSysSesCount.0"
|
||||||
fnSysMemUsage="$FNTYPE::fnSysMemUsage.0"
|
fnVPNSslStatsLoginUsers="$FNTYPE::fgVpnSslStatsLoginUsers.1"
|
||||||
fnSysSesCount="$FNTYPE::fnSysSesCount.0"
|
fnVPNSslStatsActiveWebSessions="$FNTYPE::fgVpnSslStatsActiveWebSessions.1"
|
||||||
fnVPNSslStatsLoginUsers="$FNTYPE::fnVpnSslStatsLoginUsers.1"
|
fnVPNSslStatsActiveTunnels="$FNTYPE::fgVpnSslStatsActiveTunnels.1"
|
||||||
fnVPNSslStatsActiveWebSessions="$FNTYPE::fnVpnSslStatsActiveWebSessions.1"
|
|
||||||
fnVPNSslStatsActiveTunnels="$FNTYPE::fnVpnSslStatsActiveTunnels.1"
|
|
||||||
|
|
||||||
UNIT=`$SNMPGET $fnSysVersion | cut -d ":" -f4 | cut -d " " -f2 | cut -d "\"" -f2`
|
|
||||||
SCPU=`$SNMPGET $FGTcpu | cut -d ":" -f4 | cut -d " " -f2`
|
SCPU=`$SNMPGET $FGTcpu | cut -d ":" -f4 | cut -d " " -f2`
|
||||||
SMEM=`$SNMPGET $fnSysMemUsage | cut -d ":" -f4 | cut -d " " -f2`
|
SMEM=`$SNMPGET $fnSysMemUsage | cut -d ":" -f4 | cut -d " " -f2`
|
||||||
SCNT=`$SNMPGET $fnSysSesCount | cut -d ":" -f4 | cut -d " " -f2`
|
SCNT=`$SNMPGET $fnSysSesCount | cut -d ":" -f4 | cut -d " " -f2`
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue