Cacti snmp access to remote cisco switch

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
jlh007
Posts: 2
Joined: Wed May 02, 2018 1:47 pm

Cacti snmp access to remote cisco switch

Post by jlh007 »

Hi folks,

I'm new to cacti and I'm running cacti (version 1.1.37) on my CentOS 7 (7.4.1708) system.

Using the following page (http://www.techspacekh.com/monitoring-c ... pplication) I was able to add snmp on my Cisco 3850 switch. I then ran snmpwalk -v2c -c somecactipassword ip_cisco_switch (e.g. snmpwalk -v2c -c testing123 10.10.20.2) and it successfully polled the switch.

I have a second switch that sits behind a router that I need to connect to the cacti server:

Cacti Server (192.168.10.13) ----> Cisco 4331 (10.10.30.100) ---> remote switch (20.20.20.2)

I use port forwarding on the Cisco Router (4331). So to get to the remote switch I can issue the following command from the command line on the Cacti Server "ssh -p 111 switchuser@10.10.30.100" This will then prompt me for a password and I can login.

Has anyone successfully used snmpwalk from a Cacti server to a remote switch using a port forwarder? Because I'm using a port forwarder I didn't think I needed to setup an SSH tunnel.

I did find the following article: viewtopic.php?t=24960 but I'm not having any luck getting the cacti server to talk to the remote switch.

Thanks,
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Cacti snmp access to remote cisco switch

Post by netniV »

You don't need an SSH tunnel, what you need to do is assign a port on the forwarder that will go to the SNMP port of the destination device. Then you need to make sure that the destination device allows SNMP traffic from your forwarder. Finally, you need to specify the custom port in the SNMP settings of the device within cacti, but here's the rub, Cacti expects a device only to be added once. Ergo, unless your using a virtual IP or DNS hostname, you'll run into the problem that Cacti believes this to be the same device as the forwarder itself if you use the same IP even if it's on a different port.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
jlh007
Posts: 2
Joined: Wed May 02, 2018 1:47 pm

Re: Cacti snmp access to remote cisco switch

Post by jlh007 »

Thanks netniV. I'll give that a try. I was definitely going down the wrong path. I appreciate being pointed in the right direction.

Cheers,
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Cacti snmp access to remote cisco switch

Post by netniV »

Things would be easier for you if you were using NAT rather than Port Forwarding. Is there a specific reason for port forwarding?
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests