|
|
| Author |
Message |
mgb Cacti User
Joined: 21 Jun 2004 Posts: 102 Location: North of the Netherlands
|
Posted: Mon Jul 31, 2006 4:10 am Post subject: Nortel Contivity Connections |
|
|
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: |
<?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
| Description: |
| Graph template for monitoring Nortel IPSEC and PPTP connections |
|
 Download |
| Filename: |
cacti_graph_template_nortel_connections.xml |
| Filesize: |
11.36 KB |
| Downloaded: |
650 Time(s) |
|
|
| Back to top |
|
 |
BelgianViking Cacti User
Joined: 24 Mar 2005 Posts: 94 Location: Brussels, Belgium
|
Posted: Wed Aug 02, 2006 3:34 am Post subject: |
|
|
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 !
|
|
| Back to top |
|
 |
mgb Cacti User
Joined: 21 Jun 2004 Posts: 102 Location: North of the Netherlands
|
Posted: Wed Aug 02, 2006 6:29 am Post subject: |
|
|
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
|
|
| Back to top |
|
 |
BelgianViking Cacti User
Joined: 24 Mar 2005 Posts: 94 Location: Brussels, Belgium
|
Posted: Wed Aug 02, 2006 7:18 am Post subject: |
|
|
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.
|
|
| Back to top |
|
 |
DFord
Joined: 03 May 2006 Posts: 12
|
Posted: Mon Aug 14, 2006 10:14 pm Post subject: |
|
|
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: | 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: |
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?
|
|
| Back to top |
|
 |
gandalf Developer
Joined: 02 Dec 2004 Posts: 12275 Location: Muenster, Germany
|
Posted: Tue Aug 15, 2006 12:29 pm Post subject: |
|
|
Please try using the ASN.1 numeric OIDs instead of if... stuff in nortel.php
Reinhard
|
|
| Back to top |
|
 |
t33r0y
Joined: 13 Sep 2006 Posts: 3
|
Posted: Wed Sep 13, 2006 9:09 am Post subject: |
|
|
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.
|
|
| Back to top |
|
 |
t33r0y
Joined: 13 Sep 2006 Posts: 3
|
Posted: Tue Oct 03, 2006 11:09 am Post subject: |
|
|
| 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.
|
|
| Back to top |
|
 |
mgb Cacti User
Joined: 21 Jun 2004 Posts: 102 Location: North of the Netherlands
|
Posted: Fri Oct 06, 2006 9:46 am Post subject: |
|
|
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
|
|
| Back to top |
|
 |
t33r0y
Joined: 13 Sep 2006 Posts: 3
|
Posted: Fri Oct 06, 2006 9:57 am Post subject: |
|
|
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!
|
|
| Back to top |
|
 |
mgb Cacti User
Joined: 21 Jun 2004 Posts: 102 Location: North of the Netherlands
|
Posted: Mon Oct 09, 2006 2:02 am Post subject: |
|
|
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: | $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.
|
|
| Back to top |
|
 |
karias Cacti User
Joined: 25 Oct 2006 Posts: 55
|
Posted: Mon Feb 11, 2008 10:02 am Post subject: |
|
|
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";
?>
|
|
| Back to top |
|
 |
ghamelin
Joined: 02 Sep 2008 Posts: 1
|
Posted: Tue Sep 02, 2008 6:48 pm Post subject: 100 tunnel limitation |
|
|
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: | $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";
|
|
|
| Back to top |
|
 |
zy_milan
Joined: 30 Jun 2006 Posts: 27
|
Posted: Wed Sep 10, 2008 2:51 am Post subject: |
|
|
I am unluck to encounter same problem. the session limitation is 100.
Can anyone slove this problem?
| Description: |
|
| Filesize: |
26.29 KB |
| Viewed: |
1015 Time(s) |

|
|
|
| Back to top |
|
 |
zy_milan
Joined: 30 Jun 2006 Posts: 27
|
Posted: Thu Sep 11, 2008 8:34 pm Post subject: |
|
|
it works well
| Description: |
|
| Filesize: |
28.66 KB |
| Viewed: |
945 Time(s) |

|
|
|
| Back to top |
|
 |
|