Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
03-07-2013, 01:22 AM
|
#1
|
LQ Newbie
Registered: Feb 2012
Posts: 7
Rep: 
|
Query by snmp
Hi every body
I am using Vmware Workstation and I have 2 Ubuntu Virtual Machine which I want query one of them as client by other as server.
I've installed snmpd on both of them.
how can I query client one by snmp to monitor its status?
|
|
|
03-07-2013, 02:03 AM
|
#2
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
by using an snmp client. Maybe I'm not following you.... snmpget will connect tot he server and pull back a value, if it's configured to do so. There are plenty of SNMP enabled monitoring solutions if that's what you mean. Zabbix, OpenNMS, groundwork etc.
|
|
|
03-07-2013, 02:30 AM
|
#3
|
LQ Newbie
Registered: Feb 2012
Posts: 7
Original Poster
Rep: 
|
thanks for reply
You know, I want to know how can I command manually to client and query it?
|
|
|
03-07-2013, 02:31 AM
|
#4
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
"man snmpget"
|
|
1 members found this post helpful.
|
03-07-2013, 02:42 AM
|
#5
|
LQ Newbie
Registered: Feb 2012
Posts: 7
Original Poster
Rep: 
|
and where should I determine IP address of client for server and vice versa?
|
|
|
03-07-2013, 02:47 AM
|
#6
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
determine? You should already know it in general. "ifconfig -a" will show all active interfaces on a linux system.
|
|
|
03-07-2013, 02:53 AM
|
#7
|
Senior Member
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278
Rep: 
|
You can do the snmpwalk or snmpget vice versa..
snmpwalk -v3 -On -u <user> -l AuthPriv -a SHA -A <auth_password> -X <encryption_password> -m ALL <HOST_IP>
snmpwalk -v2c -c community_name -m ALL xx.xx.xx.xx
snmpget -v1 -Cf -c public localhost system.sysUpTime system.sysContact.0
|
|
1 members found this post helpful.
|
03-07-2013, 02:55 AM
|
#8
|
LQ Newbie
Registered: Feb 2012
Posts: 7
Original Poster
Rep: 
|
thanks but I didn't mean that.
I mean this:
I want to query the snmp client, by the snmp server using snmpget. now where I should determine the client ip address for the server? is this in /etc/snmp/snmp.conf of snmp server?
|
|
|
03-07-2013, 03:04 AM
|
#9
|
LQ Newbie
Registered: Feb 2012
Posts: 7
Original Poster
Rep: 
|
Quote:
Originally Posted by kirukan
You can do the snmpwalk or snmpget vice versa..
snmpwalk -v3 -On -u <user> -l AuthPriv -a SHA -A <auth_password> -X <encryption_password> -m ALL <HOST_IP>
snmpwalk -v2c -c community_name -m ALL xx.xx.xx.xx
snmpget -v1 -Cf -c public localhost system.sysUpTime system.sysContact.0
|
thanks but by using last command I get this error:
system.sysUpTime : Unknown object Identifier (sub-id not found: (top) -> system)
system.sysUpTime.O : Unknown object Identifier (sub-id not found: (top) -> system)
|
|
|
03-07-2013, 03:54 AM
|
#10
|
Senior Member
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278
Rep: 
|
snmpget -v2c -Cf -c community_string localhost system.sysUpTime.0
Not sure which version you configured (I mean snmp)...
|
|
|
03-07-2013, 05:13 AM
|
#11
|
LQ Newbie
Registered: Feb 2012
Posts: 7
Original Poster
Rep: 
|
Quote:
Originally Posted by kirukan
snmpget -v2c -Cf -c community_string localhost system.sysUpTime.0
Not sure which version you configured (I mean snmp)...
|
thanks an ocean...
I am using version 5.4.3
sorry for silly questions but I am somehow amateur in snmp.
in /etc/snmp/snmp.conf I've configured "rocommunity public", so I typed "snmpget -v2c -Cf -c public localhost system.sysUpTime.0" , but the same error as previous.
I would be appreciate for ur help.
|
|
|
03-07-2013, 06:55 AM
|
#12
|
LQ Veteran
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Rep: 
|
sanitized working remote snmp.conf should help
Code:
syslocation <something clever here>
syscontact me@email.com
rwuser snmp_pass
rouser snmp_pass
rocommunity snmp_pass 123.123.171.149
rwcommunity snmp_pass 123.123.171.149
com2sec paranoid default snmp_pass
com2sec local 127.0.0.1 private
com2sec mynetwork 10.220.34.164 snmp_pass
123.123.171.149 designators are the allowed hosts that snmp is authorized to reply to.
This should get you started querying a remote host.
Don't forget to restart snmpd on the remote host after editing.
Please let us know...
|
|
|
03-09-2013, 03:21 AM
|
#13
|
LQ Newbie
Registered: Feb 2012
Posts: 7
Original Poster
Rep: 
|
Quote:
Originally Posted by Habitual
sanitized working remote snmp.conf should help
Code:
syslocation <something clever here>
syscontact me@email.com
rwuser snmp_pass
rouser snmp_pass
rocommunity snmp_pass 123.123.171.149
rwcommunity snmp_pass 123.123.171.149
com2sec paranoid default snmp_pass
com2sec local 127.0.0.1 private
com2sec mynetwork 10.220.34.164 snmp_pass
123.123.171.149 designators are the allowed hosts that snmp is authorized to reply to.
This should get you started querying a remote host.
Don't forget to restart snmpd on the remote host after editing.
Please let us know...
|
thank you 1 million Habitual. I got involved by snmp, and now my snmp server is runnig successfully  good guidance 
|
|
|
03-09-2013, 08:12 AM
|
#14
|
LQ Veteran
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Rep: 
|
So glad it worked out!
|
|
|
All times are GMT -5. The time now is 04:28 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|