Home Directory Plugins Network Protocols SNMP check_netscreen_session

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

check_netscreen_session

Rating
4 votes
Favoured:
0
Hits
147654
Files:
FileDescription
check_netscreen_sessionPerlscript
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
Check the percent of session used on a Netscreen/Juniper firewall through SNMP.
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)
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=%s\n",
+$perfdata = sprintf("| SessActive=%s, SessMax=%s, SessFail=%s\n",

Thanks
byjohn_lines, July 10, 2014
1 of 1 people found this review helpful
--- 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=%s\n",
+ $response->{$snmpnsResSessActive},
+ $response->{$snmpnsResSessMaximum},
+ $response->{$snmpnsResSessFailed}
+ );
+

$session->close;

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

-print ("$state: $answer");
+print ("$state: $answer $perfdata\n");
exit $ERRORS{$state};
bymcmonitor, January 15, 2014
Plugin works fine. The diff works well too. (Juniper SSG).
bysvindler, March 14, 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=%s\n",
147c147,149
$session_used,
> $response->{$snmpnsResSessActive},
> $response->{$snmpnsResSessMaximum}