Netscreen Template Issue

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
packet7
Posts: 30
Joined: Thu Mar 29, 2007 9:10 am

Netscreen Template Issue

Post by packet7 »

Hi,

I was able to get the Netscreen Tunnel Interface and Policy Counters templates/scripts working with some minor tweaks. Unfortunately, I am unable to get the Session, Load, and Memory templates working.

The templates imported just fine and SNMP is working. I created the graphs, but nothing is being recorded. The graphs have been blank for over 60 minutes. Do I need to associate a Data Query too (see attached)? I tried using the data query drop down menu, but the other netscreen templates weren't listed.

Anyone know how to fix or troubleshoot this? Thanks!

Rgds,

John
Attachments
ns-dataqueries.PNG
ns-dataqueries.PNG (17.11 KiB) Viewed 3616 times
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Yes, a graph template must be fed by a valid data template, which in tern is fed by either a Data Input Method or Data Queries. Do you have those for the Session, Load, and Memory?
packet7
Posts: 30
Joined: Thu Mar 29, 2007 9:10 am

Post by packet7 »

Hello,

I have the following:

cacti_data_template_netscreen_stats.xml (imported as template)
cacti_graph_graph_template_netscreen_load_average.xml (imported as template)
cacti_graph_template_netscreen_memory.xml (imported as template)
cacti_graph_template_netscreen_sessions.xml (imported as template)
netscreen_stats.pl (copied to scripts folder)
Netscreen - stats (data template)
No data query for this.
Netscreen - stats (Data Input Method)

I ran an snmpwalk using the info from the *.pl and I did get results back. Do I need to create a Data Query and link it to the Data Input Method? I think I need to add something, unfortunately I don't know what! :o)

Anyway, any suggestions? Thank you!

John
packet7
Posts: 30
Joined: Thu Mar 29, 2007 9:10 am

Post by packet7 »

Hi,

I noticed the following after enabling debug mode:

10/06/2007 08:30:12 PM - CMDPHP: Poller[0] Host[3] DS[64] CMD: /srv/cacti/scripts/netscreen_stats.pl 10.109.4.50 SECRET, output: U
10/06/2007 08:30:12 PM - CMDPHP: Poller[0] Host[3] DS[64] WARNING: Result from CMD not valid. Partial Result:

I have been searching for a fix without any luck. Thanks for your help.

Rgds,

John
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

1) you need to figure out where the graph should be getting its data from.

2) manually run that perl script; does it return data?
packet7
Posts: 30
Joined: Thu Mar 29, 2007 9:10 am

Post by packet7 »

Hi,

It appears to me that the script worked (see below). I also included the contents of the script (see below). Please keep me posted. Thanks for your help.

[root@usnyc1cal01 bin]# ./perl /srv/cacti/scripts/netscreen_stats.pl 10.109.4.50 SECRET
cpu1:7 cpu5:6 cpu15:7 memory_allocated:169505520 memoryAvailable:53033120 memoryFragmented:438 sessionsAllocated:1523 sessionsMaximum:250064 sessionsFailed:0 [root@usnyc1cal01 bin]#


#!/usr/bin/perl

# Copyright - Fletcher Cocquyt - fletch@med.stanford.edu
# 15 January 2004 under the GPL license agreement!
#
# Version 0.1 - PLEASE SEE INSTALL.txt for more information.
#
# USAGE:
#
# perl netscreen_stats.pl <hostname>
#
# <hostname> is optional and can be an IP address or host name.
# If none is given, "localhost" is assumed.
#

my $hostname = $ARGV[0];
my $community = $ARGV[1];

chomp $hostname;
chomp $community;

if ($hostname eq '') {
$hostname = "localhost";
}


$output = `snmpwalk -v 1 -c $community $hostname .1.3.6.1.4.1.3224.16 `;

$output =~ /SNMPv2-SMI::enterprises.3224.16.1.2.0 = INTEGER: (.*)/;
print "cpu1:".$1." ";
$output =~ /SNMPv2-SMI::enterprises.3224.16.1.3.0 = INTEGER: (.*)/;
print "cpu5:".$1." ";
$output =~ /SNMPv2-SMI::enterprises.3224.16.1.4.0 = INTEGER: (.*)/;
print "cpu15:".$1." ";
$output =~ /SNMPv2-SMI::enterprises.3224.16.2.1.0 = INTEGER: (.*)/;
print "memory_allocated:".$1." ";
$output =~ /SNMPv2-SMI::enterprises.3224.16.2.2.0 = INTEGER: (.*)/;
print "memoryAvailable:".$1." ";
$output =~ /SNMPv2-SMI::enterprises.3224.16.2.3.0 = INTEGER: (.*)/;
print "memoryFragmented:".$1." ";
$output =~ /SNMPv2-SMI::enterprises.3224.16.3.2.0 = INTEGER: (.*)/;
print "sessionsAllocated:".$1." ";
$output =~ /SNMPv2-SMI::enterprises.3224.16.3.3.0 = INTEGER: (.*)/;
print "sessionsMaximum:".$1." ";
$output =~ /SNMPv2-SMI::enterprises.3224.16.3.4.0 = INTEGER: (.*)/;
print "sessionsFailed:".$1." ";

Rgds,

John
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Hmm, well since the script is just doing snmp, you would be a LOT better off if you converted it to a snmp data query for cacti. Much faster and efficient. Read http://docs.cacti.net/node/70 on how to make your own.
packet7
Posts: 30
Joined: Thu Mar 29, 2007 9:10 am

Post by packet7 »

Hi,

OK, thanks. I wish I had the script/programming skills to get this done, but I don't. That being said I will read the documentation and give it a shot. If you have any pointers regarding how I could convert the .pl script I would appreciate it.

Thank you.

Rgds,

John
packet7
Posts: 30
Joined: Thu Mar 29, 2007 9:10 am

Post by packet7 »

Hello,

I found a Netscreen Host template that included what I was trying to do (Memory, Sessions, CPU). I simply deleted the old templates that required the .pl and imported the new one. Thank you.

Rgds,

John
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests