Nortel Contivity Connections

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

Moderators: Developers, Moderators

mgb
Cacti User
Posts: 124
Joined: Mon Jun 21, 2004 4:06 am
Location: North of the Netherlands

Nortel Contivity Connections

Post by mgb »

Graph Template for graphing the number of VPN connections on a Nortel Contivity router.

Consists of an XML file and a little php scripting.

Put the php script in the <cacti dir>/scripts/ directory.
The source for the script is:

Code: Select all

<?php
$no_http_headers = true;

$IP = $_SERVER["argv"][1];
$Community = $_SERVER["argv"][2];
$OID = "ifTable.ifEntry.ifDescr";

$a = snmpwalk($IP,$Community,$OID);
$N_IPSec = 0;
$N_PPTP = 0;
foreach ($a as $val)
{
  if (strpos($val,"Type=IPSec"))
    $N_IPSec++;
  if (strpos($val,"Type=PPTP"))
    $N_PPTP++;
//  echo "$val\n";
}
?>
name the file nortel.php

this should work in combination with the XML file.
might be that the absolute paths in the Data Imput Methods are wrong
Attachments
cacti_graph_template_nortel_connections.xml
Graph template for monitoring Nortel IPSEC and PPTP connections
(11.36 KiB) Downloaded 1595 times
BelgianViking
Cacti User
Posts: 97
Joined: Thu Mar 24, 2005 4:59 am
Location: Brussels, Belgium

Post by BelgianViking »

I have some problems with these !
1)I ran the php script manually, and it would complain about an "invalid object identifier: ifTable......". So I changed the script to contain $OID = "1.3.6.1.2.1.2.2.1.2". To check if that works, I added an ECHO of $val in the foreach loop, but I get nothing at all. The result of the script is nothing at all too.
I'm sure there are tunnels, and "snmpwalk -v 2c -c ***** 172.29.3.203 1.3.6.1.2.1.2.2.1.2" gives me the right result.

2) when I try to load the XML, it gives me an XML parse error. Could this be due to a different cacti version ?

Thanks in advance for giving me some clues !
[size=75][color=#EE5019]| Cacti 0.8.6g | MySQL 4.1.14 w Query Cache | Net-SNMP 5.2.1 | IIS 6 | fast-cgi | PHP 5.0.3 | RRDtool 1.2.9 | Windows 2003 Server SP1 | Cactid 0.8.6f |
| Dell 2450 - 2x P3 733 MHz, 1GB RAM |[/size][/color]
mgb
Cacti User
Posts: 124
Joined: Mon Jun 21, 2004 4:06 am
Location: North of the Netherlands

Post by mgb »

I'm running the script on a linux system so that could be a the problem for the missing MIB. The script should be run like this:

php -q nortel.php <IP> <Community>

$VAL should return something.

I don't know why the XML file won't import in your cacti. It was exported with version 0.8.6h

I recall from memory that there was some sort of problem with importing templates in version 0.8.6g
BelgianViking
Cacti User
Posts: 97
Joined: Thu Mar 24, 2005 4:59 am
Location: Brussels, Belgium

Post by BelgianViking »

Yeah, I think the XML problem is due to the version than.
I'm on a windows system, so that's where the other problems must come from. I changed the script and got it running fine on the command line, and than I made the necessary methods and templates in Cacti. Works fine now.
Thanks.
[size=75][color=#EE5019]| Cacti 0.8.6g | MySQL 4.1.14 w Query Cache | Net-SNMP 5.2.1 | IIS 6 | fast-cgi | PHP 5.0.3 | RRDtool 1.2.9 | Windows 2003 Server SP1 | Cactid 0.8.6f |
| Dell 2450 - 2x P3 733 MHz, 1GB RAM |[/size][/color]
DFord
Posts: 12
Joined: Wed May 03, 2006 10:31 pm

Post by DFord »

Trying to run this on a Windows installation - The graph is empty, although I get SNMP basic data in the device setup. When running the script from the command line, I get the following error:

Code: Select all

C:\Inetpub\wwwroot\cacti\scripts>php -q nortel.php <xx.xx.xx.xx> <xcommunityx>

Warning: snmpwalk(): Invalid object identifier: ifTable.ifEntry.ifDescr in C:\In
etpub\wwwroot\cacti\scripts\nortel.php on line 8
And running the following command:

Code: Select all

snmpwalk -v 2c -c <xcommunityx> <xx.xx.xx.xx> 1.3.6.1.2.1.2.2.1.2
Shows that there are tunnels present...

Can anyone help?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please try using the ASN.1 numeric OIDs instead of if... stuff in nortel.php
Reinhard
t33r0y
Posts: 3
Joined: Wed Sep 13, 2006 9:06 am

Post by t33r0y »

I am able to run this script with no erros but I am getting no data. I replaced the OID line with the ANS.1 OID number but still nothing.

If I run "snmpwalk -v2c -c <mycommunity> hostip 1.3.6.1.2.1.2.2.1.2" I get the interfaces returned including the IPSec tunnels.

Any help is greatly appreciated.
t33r0y
Posts: 3
Joined: Wed Sep 13, 2006 9:06 am

Post by t33r0y »

Has anyone gotten this script to work? If so, can you share the changes you made to get this working? I have just started working on it again on my machine and this is the one script that does not seem to work.
mgb
Cacti User
Posts: 124
Joined: Mon Jun 21, 2004 4:06 am
Location: North of the Netherlands

Post by mgb »

are you able to run the script by hand?
php -q ./nortel.php <ip> <community>
If so you should receive somthing like:
ipsec:37 pptp:4

also, there seems to be a 100 limit for both ipsec and pptp
t33r0y
Posts: 3
Joined: Wed Sep 13, 2006 9:06 am

Post by t33r0y »

I do not get anything from the script. I run the script as you mention and it just goes back to the prompt. If I uncomment your echo line I can see the script output the list of connections. The script is working but not outputting the data correctly.

I can give you more information if you need it. Just let me know as I would really like to get this script working.

Thank you!
mgb
Cacti User
Posts: 124
Joined: Mon Jun 21, 2004 4:06 am
Location: North of the Netherlands

Post by mgb »

Could you post the output you have when you uncomment the echo statement. Maybe it has something to do with uppercase lowercase since the count part of the script is pretty straightforward.

Code: Select all

$N_IPSec = 0;
$N_PPTP = 0;
foreach ($a as $val)
{
  if (strpos($val,"Type=IPSec"))
    $N_IPSec++;
  if (strpos($val,"Type=PPTP"))
    $N_PPTP++;
//  echo "$val\n";
}
print "ipsec:" . $N_IPSec . " pptp:" . $N_PPTP . "\n";
It just looks for the Type IPSec and PPTP. Maybe I should first lowercase the output before stringchecking it.
karias
Cacti User
Posts: 60
Joined: Wed Oct 25, 2006 10:36 am

Post by karias »

Anyone get this to work? I've modified the script a little bit to get the output for the variables, but its not graphing with the templates provided...

*UPDATE* I got it to work with the following code below and now am getting the data graphed.

<?php
$no_http_headers = true;

$ip = $_SERVER["argv"][1];
$community = $_SERVER["argv"][2];
$oid = "ifTable.ifEntry.ifDescr";

$a = snmpwalk($ip,$community,$oid);
$n_ipsec = 0;
$n_pptp = 0;
foreach ($a as $val)
{
if (strpos($val,"Type=IPSec"))
$n_ipsec++;
if (strpos($val,"Type=PPTP"))
$n_pptp++;
// echo "$val\n";
}
print "ipsec:" . $n_ipsec . " pptp:" . $n_pptp . "\n";
?>
ghamelin
Posts: 1
Joined: Tue Sep 02, 2008 6:41 pm

100 tunnel limitation

Post by ghamelin »

Good day folks,

I just wanted to confirm my success in using the code below, it is graphing up to a maximum of 100 connections on both my 3700 and 3600 series concentrators.

However, it does only graph to 100 concurrent connections, the most recent output of the script run manually is
ipec:121 pptp:0

Being as unfamiliar with PHP as I am; Is this a limitation of the script, or the data template within cacti itself? I've played briefly with modifying the template.. no luck as of yet.

td;dr - Has anyone managed to graph more than 100 connections?

Code: Select all

$N_IPSec = 0;
$N_PPTP = 0;
foreach ($a as $val)
{
  if (strpos($val,"Type=IPSec"))
    $N_IPSec++;
  if (strpos($val,"Type=PPTP"))
    $N_PPTP++;
//  echo "$val\n";
}
print "ipsec:" . $N_IPSec . " pptp:" . $N_PPTP . "\n";
zy_milan
Posts: 28
Joined: Fri Jun 30, 2006 4:11 am

Post by zy_milan »

I am unluck to encounter same problem. the session limitation is 100.

Can anyone slove this problem?
Attachments
untitled.JPG
untitled.JPG (26.29 KiB) Viewed 19753 times
zy_milan
Posts: 28
Joined: Fri Jun 30, 2006 4:11 am

Post by zy_milan »

it works well
Attachments
GZ1.JPG
GZ1.JPG (28.66 KiB) Viewed 19683 times
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests