Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


Nortel Contivity Connections

 
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates
Author Message
mgb
Cacti User


Joined: 21 Jun 2004
Posts: 102
Location: North of the Netherlands

PostPosted: Mon Jul 31, 2006 4:10 am    Post subject: Nortel Contivity Connections Reply with quote

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



cacti_graph_template_nortel_connections.xml
 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

PostPosted: Wed Aug 02, 2006 3:34 am    Post subject: Reply with quote

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

PostPosted: Wed Aug 02, 2006 6:29 am    Post subject: Reply with quote

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

PostPosted: Wed Aug 02, 2006 7:18 am    Post subject: Reply with quote

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

PostPosted: Mon Aug 14, 2006 10:14 pm    Post subject: Reply with quote

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

PostPosted: Tue Aug 15, 2006 12:29 pm    Post subject: Reply with quote

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

PostPosted: Wed Sep 13, 2006 9:09 am    Post subject: Reply with quote

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

PostPosted: Tue Oct 03, 2006 11:09 am    Post subject: Reply with quote

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

PostPosted: Fri Oct 06, 2006 9:46 am    Post subject: Reply with quote

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

PostPosted: Fri Oct 06, 2006 9:57 am    Post subject: Reply with quote

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

PostPosted: Mon Oct 09, 2006 2:02 am    Post subject: Reply with quote

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

PostPosted: Mon Feb 11, 2008 10:02 am    Post subject: Reply with quote

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

PostPosted: Tue Sep 02, 2008 6:48 pm    Post subject: 100 tunnel limitation Reply with quote

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

PostPosted: Wed Sep 10, 2008 2:51 am    Post subject: Reply with quote

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

Can anyone slove this problem?



untitled.JPG
 Description:
 Filesize:  26.29 KB
 Viewed:  1044 Time(s)

untitled.JPG


Back to top
zy_milan



Joined: 30 Jun 2006
Posts: 27

PostPosted: Thu Sep 11, 2008 8:34 pm    Post subject: Reply with quote

it works well


GZ1.JPG
 Description:
 Filesize:  28.66 KB
 Viewed:  974 Time(s)

GZ1.JPG


Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group