SNMP

check_netscreen_session

Description:

Check the percent of session used on a Netscreen/Juniper firewall through SNMP.

Current Version

Last Release Date

June 23, 2009

Compatible With


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!
Project Files
Project Notes
check_netscreen_session plugin for Nagios monitors the number of sessions for a Netscreen/Juniper host Usage: -H (--hostname) Hostname to query - (required) -C (--community) SNMP read community (defaults to public, used with SNMP v1 and v2c) -v (--snmp_version) 1 for SNMP v1 (default) 2 for SNMP v2c -p (--port) SNMP port (default 161) -V (--version) Plugin version -h (--help) usage help Plugin is in perl Requirements: Net-SNMP, perl Net::SNMP module Your firewalls must have SNMP enabled, your monitoring host must be authorized on the firewall.
Reviews (4) Add a Review
perfdata pnp4nagios tweak
by agentdavidson, April 30, 2017
I found I had to add a 'space' in the perfdata print statement in order for pnp4nagios to process the perfdata correctly
-$perfdata = sprintf("| SessActive=%s,SessMax=%s,SessFail=%sn",
+$perfdata = sprintf("| SessActive=%s, SessMax=%s, SessFail=%sn",

Thanks
Helpful? Yes  No 
works well - I have a patch to include Session Fails and perf data
by john_lines, July 31, 2014
--- check_netscreen_session.orig 2014-07-10 11:30:07.546043211 +0100
+++ check_netscreen_session 2014-07-10 11:48:46.120006720 +0100
@@ -25,6 +25,7 @@
#
# This plugin is based on existing work from warrious users.
# No liability
+# John Lines modifications to report number of session errors and return performance information

use POSIX;
use strict;
@@ -42,12 +43,14 @@

my $state = "UNKNOWN";
my $answer = "";
+my $perfdata = "";
my $snmpkey = 0;
my $community = "public";
my $port = 161;
my @snmpoids;
my $snmpnsResSessActive = '.1.3.6.1.4.1.3224.16.3.2.0';
my $snmpnsResSessMaximum = '.1.3.6.1.4.1.3224.16.3.3.0';
+my $snmpnsResSessFailed = '.1.3.6.1.4.1.3224.16.3.4.0';
my $hostname;
my $session;
my $error;
@@ -87,7 +90,7 @@
}

if ($opt_V) {
- print_revision($PROGNAME,'$Revision: 1.1 $ ');
+ print_revision($PROGNAME,'$Revision: 1.2 $ ');
exit $ERRORS{'OK'};
}

@@ -130,6 +133,7 @@

push(@snmpoids,$snmpnsResSessActive);
push(@snmpoids,$snmpnsResSessMaximum);
+push(@snmpoids,$snmpnsResSessFailed);

if (!defined($response = $session->get_request(@snmpoids))) {
$answer=$session->error;
@@ -140,12 +144,18 @@
}

if($snmpnsResSessMaximum ne 0) {$session_used = 100*($response->{$snmpnsResSessActive}/$response->{$snmpnsResSessMaximum});}
- $answer = sprintf("host '%s', sessions : %s/%s (%2.2f%%)n",
+ $answer = sprintf("host '%s', sessions : %s/%s (%2.2f%%)",
$hostname,
$response->{$snmpnsResSessActive},
$response->{$snmpnsResSessMaximum},
$session_used
);
+ $perfdata = sprintf("| SessActive=%s,SessMax=%s,SessFail=%sn",
+ $response->{$snmpnsResSessActive},
+ $response->{$snmpnsResSessMaximum},
+ $response->{$snmpnsResSessFailed}
+ );
+

$session->close;

@@ -160,7 +170,7 @@
}
}

-print ("$state: $answer");
+print ("$state: $answer $perfdatan");
exit $ERRORS{$state};
1 of 1 found this review helpful.
Helpful? Yes 1 No 0
Works fine
by mcmonitor, January 31, 2014
Plugin works fine. The diff works well too. (Juniper SSG).
Helpful? Yes  No 
Very useful
by svindler, March 31, 2013
Works fine.
I have used on a Nagios Core running on Ubuntu, and on Nagios XI running on centos.
I made the following change for Nagios XI to automatically create graphs:
143c143
$answer = sprintf("host '%s', sessions : %s/%s (%2.2f%%)|Current=%s;Maximum=%sn",
147c147,149
$session_used,
> $response->{$snmpnsResSessActive},
> $response->{$snmpnsResSessMaximum}
Helpful? Yes  No 
Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
4.3 (4)
Favorites
0
Views
151,435