Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

Check Fortigate Status

Current Version
1.0
Last Release Date
2012-02-24
Compatible With
  • Nagios 3.x
Hits
94432
Files:
FileDescription
check_fortigate_statuscheck_fortigate_status
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
This script is a modification of "Check Fortigate CPU load" (or check_fortigate_cpu.pl).

I have modified it to work with our models (200A and 80C).

Perhaps someone will find it useful.

It works for CPU and RAM usage, as well as active sessions.
Performance data is also produced.
For this script to work, SNMP needs to be enabled in your FortiGate config, both for the appropriate network interface and in the Config section.
The community name should be "public".

The "snmp" package should also be installed on the Linux side of things.




Usage: check_fortigate_status -H host -m mode [-C community] [-M X] [-w XX] [-c XX]

Options:

-H, --host hostname (or IP address)
Check interface on the indicated host.

-m, --mode STRING
What to check
Valid values are:
cpu Returns CPU usage
memory Returns memory usage
sessions Returns the number of active IP sessions

-C, --community STRING
SNMP community string
Default: public

-M, --modus X
0: Just monitor, no alarms
1: Threshold excesses will cause alarms
Default: 2

-w, --warn XX
Nagios warning threshold
Percent value for "memory" and "cpu" modes
Default: 80%
Integer value for "sessions" mode
Default: 1500

-c, --crit XX
Nagios critical threshold
Percent value for "memory" and "cpu" modes
Default: 90%
Integer value for "sessions" mode
Default: 2000
Reviews (2)
byaltmas5, November 1, 2013
Great script
I changed the OIDs in order to get it functional for my FG200B.
cpu= .1.3.6.1.4.1.12356.101.4.1.3.0
mem= .1.3.6.1.4.1.12356.101.4.1.4.0
ses= .1.3.6.1.4.1.12356.101.4.1.8.0
bydistels, October 11, 2013
1 of 1 people found this review helpful
This script works perfectly for our fortigates.
It did need a fix concerning the sessions-argument.

If you comment out the following two lines you can use the -w and -c options with -m sessions, else it will keep using the default of 1500 (which I don't want to use)

} elsif ($mode =~ "ses") {
@sesArray = split(" ", $snmpCommand);
$usage = @sesArray[-1];
# $warn = "1500";
# $crit = "2000";
$usagestring = "Active IP Sessions";

I'm no perl programmer so don't know exactly why this isn't working. Maybe the author can fix this :)

Thanks for your script.