[SOLVED] SNMP

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
madunix
Posts: 13
Joined: Sun Apr 10, 2005 8:58 am

[SOLVED] SNMP

Post by madunix »

[root@linux1 ~]# service snmpd restart
Stopping snmpd: [ OK ]
Starting snmpd: [ OK ]

vi /etc/snmp/snmpd.conf

rocommunity secret
#agentaddress 10.5.1.31:161
#rocommunity public 127.0.0.1
#rocommunity public 10.5.1.31
#agentaddress 10.20.30.40:10000
#agentaddress tcp:161
#syslocation Bat. C2
#syscontact someone@somewhere.org
#dontPrintUnits true
#includeAllDisks
#disk /
#proc httpd

[root@linux1 ~]# snmpwalk -v 1 -c secret localhost .1.3.6.1.2.1.1.1.0
SNMPv2-MIB::sysDescr.0 = STRING: Linux linux1.sdc.lan 2.6.18-53.1.4.el5 #1 SMP Wed Nov 14 10:37:27 EST 2007 x86_64
[root@linux1 ~]#


whith this above configuration the snmpwalk works on the localhost, but when i try to run it on the main server linux2
to collect snmp from the linux1, it wont work

[root@linux2 cli]# snmpwalk -v 1 -c secret 10.5.1.31 .1.3.6.1.2.1.1.1.0
Timeout: No Response from 10.5.1.31
[root@linux2 cli]# telnet 10.5.1.31 161
Trying 10.5.1.31...
telnet: connect to address 10.5.1.31: Connection refused
telnet: Unable to connect to remote host: Connection refused

any help
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Hi

I bet there's a firewall between linux1 and linux2 hosts...
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
madunix
Posts: 13
Joined: Sun Apr 10, 2005 8:58 am

Post by madunix »

[root@linux2 cli]# ping linux1
PING linux1.sdc.lan (10.5.1.31) 56(84) bytes of data.
64 bytes from 10.5.1.31: icmp_seq=1 ttl=64 time=0.159 ms
64 bytes from 10.5.1.31: icmp_seq=2 ttl=64 time=0.137 ms

--- linux1.sdc.lan ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.137/0.148/0.159/0.011 ms
[root@linux2 cli]#



[root@linux1 ~]# ping linux2
PING linux2.sdc.lan (10.5.1.32) 56(84) bytes of data.
64 bytes from 10.5.1.32: icmp_seq=1 ttl=64 time=0.158 ms

--- linux2.sdc.lan ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.158/0.158/0.158/0.000 ms
[root@linux1 ~]#

Chain RH-Firewall-1-INPUT (2 references)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT icmp -- anywhere anywhere icmp any
ACCEPT esp -- anywhere anywhere
ACCEPT ah -- anywhere anywhere
ACCEPT udp -- anywhere 224.0.0.251 udp dpt:mdns
ACCEPT udp -- anywhere anywhere udp dpt:ipp
ACCEPT tcp -- anywhere anywhere tcp dpt:ipp
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ftp
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:smtp
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:https
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:http
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:squid
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ndmp
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:rxmon
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:5091
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:clariion-evr01
ACCEPT udp -- anywhere anywhere state NEW udp dpt:domain
ACCEPT udp -- anywhere anywhere state NEW udp dpt:ndmp
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:nrpe
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:snmp
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Can you stop iptables on both servers to test ?
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
madunix
Posts: 13
Joined: Sun Apr 10, 2005 8:58 am

Post by madunix »

yep it works now Firewall probs :)
after adding
-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 161 -j ACCEPT

thnaks
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest