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    


Cisco Pix - Authenticated VPN Users
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates
Author Message
speedy



Joined: 23 Jun 2006
Posts: 5

PostPosted: Fri Jun 23, 2006 4:59 am    Post subject: Cisco Pix - Authenticated VPN Users Reply with quote

Hello,

here is a template for the Cisco Pix firewall, which shows the number of authenticated VPN users.

Unfortunetly I find no way to get the number of authenticated users using snmp.
Because of this I wrote a Perl script, which connects over telnet to the firewall , executes the command "sh unauth" and calculates the number of connected users.

Installation Instructions:

1. extract the file pix-vpn-users.zip and copy pix-vpn-users.pl into <path_cacti>/scripts/pix-vpn-users.pl
2. Import the Template cacti_graph_template_cisco_vpn_active_vpn_users.xml
3. Allow Telnet connection to firewall
4. If you don't need a username for telnet login, delete the input field username from "Data Input Methods" --> "Cisco VPN - Active VPN users" in Cacti Gui.

Regards

Speedy



graph_image.php.png
 Description:
 Filesize:  17.51 KB
 Viewed:  15722 Time(s)

graph_image.php.png



pix-vpn-users.zip
 Description:
extract file and copy to /scripts/pix-vpn-users.pl

Download
 Filename:  pix-vpn-users.zip
 Filesize:  895 Bytes
 Downloaded:  1438 Time(s)


cacti_graph_template_cisco_vpn_active_vpn_users.xml
 Description:
import from GUI

Download
 Filename:  cacti_graph_template_cisco_vpn_active_vpn_users.xml
 Filesize:  10.26 KB
 Downloaded:  1533 Time(s)



Last edited by speedy on Tue Jun 27, 2006 2:21 am; edited 3 times in total
Back to top
RUM



Joined: 22 Jun 2006
Posts: 20

PostPosted: Mon Jun 26, 2006 4:16 am    Post subject: Reply with quote

Hi Speedy,

Thanks for the Template. It's a nice, useable feature.

I was able to get the graph shown, but there is no data on it. Do you know how it's possible?

Thanks in advance
Back to top
speedy



Joined: 23 Jun 2006
Posts: 5

PostPosted: Mon Jun 26, 2006 4:34 am    Post subject: Reply with quote

Hi,

maybe the perl script isn't executed correctly.
Please check if you are able to execute the script from the command line:

./pix-vpn-users.pl -r <router> -u <username> -p <password> -e <enable password>

You should get the number of connected vpn users.

Regards

speedy
Back to top
RUM



Joined: 22 Jun 2006
Posts: 20

PostPosted: Mon Jun 26, 2006 4:57 am    Post subject: Reply with quote

Hi Speedy,

Thanks for the quick reply. I'm still not sure if it is executing correctly, because maybe I'm running it wrong at the command line. I typed:

C:\cacti2\scripts>pix-vpn-users.pl -r <ipaddress router> -u <> -p <password> -e <enable>
> was unexpected at this time.

Note that the username is null and in cacti I allowed it to have a null value. Also when I write <null> as username or when I write the hostname instead of the IP address of the router, it says that the syntax is incorrect. Can I do it diferently?

Regards
Back to top
speedy



Joined: 23 Jun 2006
Posts: 5

PostPosted: Mon Jun 26, 2006 5:46 am    Post subject: Reply with quote

Hi RUM,

at the moment the script isn't able to handle a blank username. I will change it and post the new version.
Back to top
RUM



Joined: 22 Jun 2006
Posts: 20

PostPosted: Mon Jun 26, 2006 5:47 am    Post subject: Reply with quote

Thanks I will keep an eye on this topic for updates.

Regards
Back to top
RUM



Joined: 22 Jun 2006
Posts: 20

PostPosted: Mon Jun 26, 2006 5:51 am    Post subject: Reply with quote

By the way,

Since you are a PIX user as well, maybe you can help me with this problem:

http://forums.cacti.net/viewtopic.php?t=14389&highlight=

If not, no hard feelings ofcourse.

Regards
Back to top
speedy



Joined: 23 Jun 2006
Posts: 5

PostPosted: Mon Jun 26, 2006 7:56 am    Post subject: Reply with quote

I have updated the scripts. Please delete the username from the Data Input method "Cisco VPN - Active VPN users" if you don't want to use a username for telnet login.

Regards

speedy
Back to top
RUM



Joined: 22 Jun 2006
Posts: 20

PostPosted: Mon Jun 26, 2006 9:43 am    Post subject: Reply with quote

Hi,

Thanks for updating so fast Speedy, well ofcourse, that's why you're called Speedy.

Now, I have one problem left. I looked at the poller when it runs. It doesn't seem to recognize the password of the router, or at least part of the password. It tells me that: &xcvjk (example password), is not recognized as an internal or external command.

Is it possible that it's because of the & character?

Regards
Back to top
knobdy
Cacti User


Joined: 28 Sep 2005
Posts: 495

PostPosted: Mon Jun 26, 2006 11:19 am    Post subject: Reply with quote

Hey Speedy, thanks for the template!

I've been desperate to find a way to monitor VPN connections to a couple of PIXen and a couple of 2600 routers. Like you, I haven't found any SNMP/MIB support for VPN monitoring.

Having seen your script, I'm wondering if I might be able to edit it for use with Nagios to verify specific tunnels. If you know how to do this already, please share!
Back to top
speedy



Joined: 23 Jun 2006
Posts: 5

PostPosted: Tue Jun 27, 2006 2:33 am    Post subject: Reply with quote

Hi,

sorry there was a mistake in the new script. Please download the new version.

For the password problem try to put the password into quotes. Normally the chracter & is used for command execution.

There is no problem to use the script to execute other commands. You only have to replace the command in the line "print $handle "sh uauth\n";" and change the section for output handling.

Otherwise take a look at the MRAT Tool:
http://www.serreyn.com/software/mrat/

Regards

speedy
Back to top
knobdy
Cacti User


Joined: 28 Sep 2005
Posts: 495

PostPosted: Tue Jun 27, 2006 4:15 pm    Post subject: Reply with quote

speedy wrote:

There is no problem to use the script to execute other commands. You only have to replace the command in the line "print $handle "sh uauth\n";" and change the section for output handling.


No problem for you maybe... I, on the otherhand, will spend a week pouring over the meaning of everything in the output section.
Back to top
kharford



Joined: 07 Jul 2005
Posts: 40
Location: Mass, USA

PostPosted: Mon Sep 25, 2006 1:40 pm    Post subject: Reply with quote

Has anyone wrote a script that uses ssh instead of telnet?

Thanks
Back to top
JJX
Cacti User


Joined: 06 Oct 2005
Posts: 171

PostPosted: Thu Sep 28, 2006 8:30 am    Post subject: Reply with quote

RUM wrote:
Hi,

Thanks for updating so fast Speedy, well ofcourse, that's why you're called Speedy.

Now, I have one problem left. I looked at the poller when it runs. It doesn't seem to recognize the password of the router, or at least part of the password. It tells me that: &xcvjk (example password), is not recognized as an internal or external command.

Is it possible that it's because of the & character?

Regards


replace & with \&
Back to top
egarnel
Cacti Pro User


Joined: 21 Nov 2002
Posts: 630
Location: Austin, TX

PostPosted: Tue Oct 24, 2006 8:34 am    Post subject: revisting this Reply with quote

check out remote-access under the CLI in ver 7.2.1... I believe this may be what you are looking for

per the cli:

Quote:
remote-access Configure SNMP trap threshold for VPN remote-access
sessions


granted, it is for thresholding, at least you can trigger an snmp trap
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
Goto page 1, 2  Next
Page 1 of 2

 



Powered by phpBB © 2001, 2005 phpBB Group