LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-07-2013, 01:22 AM   #1
masoumeh
LQ Newbie
 
Registered: Feb 2012
Posts: 7

Rep: Reputation: Disabled
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?
 
Old 03-07-2013, 02:03 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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.
 
Old 03-07-2013, 02:30 AM   #3
masoumeh
LQ Newbie
 
Registered: Feb 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
thanks for reply

You know, I want to know how can I command manually to client and query it?
 
Old 03-07-2013, 02:31 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
"man snmpget"
 
1 members found this post helpful.
Old 03-07-2013, 02:42 AM   #5
masoumeh
LQ Newbie
 
Registered: Feb 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
and where should I determine IP address of client for server and vice versa?
 
Old 03-07-2013, 02:47 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
determine? You should already know it in general. "ifconfig -a" will show all active interfaces on a linux system.
 
Old 03-07-2013, 02:53 AM   #7
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278

Rep: Reputation: 148Reputation: 148
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.
Old 03-07-2013, 02:55 AM   #8
masoumeh
LQ Newbie
 
Registered: Feb 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
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?
 
Old 03-07-2013, 03:04 AM   #9
masoumeh
LQ Newbie
 
Registered: Feb 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by kirukan View Post
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)
 
Old 03-07-2013, 03:54 AM   #10
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278

Rep: Reputation: 148Reputation: 148
snmpget -v2c -Cf -c community_string localhost system.sysUpTime.0
Not sure which version you configured (I mean snmp)...
 
Old 03-07-2013, 05:13 AM   #11
masoumeh
LQ Newbie
 
Registered: Feb 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by kirukan View Post
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.
 
Old 03-07-2013, 06:55 AM   #12
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
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...
 
Old 03-09-2013, 03:21 AM   #13
masoumeh
LQ Newbie
 
Registered: Feb 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
Smile

Quote:
Originally Posted by Habitual View Post
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
 
Old 03-09-2013, 08:12 AM   #14
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
So glad it worked out!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Query for SNMP NOTIFICATION-TYPE dashang.trivedi Linux - Server 2 05-05-2011 10:05 AM
snmp query from virtual interface orko Linux - Networking 0 04-08-2008 02:22 PM
SNMP query outour to be dumped directly into Mysql DB manya Linux - Software 1 09-17-2007 08:38 AM
Linux Bridge Vlan Query switch SNMP christopherccv Linux - Networking 2 05-15-2006 10:12 PM
snmp (ucd-snmp, net-snmp) markus1982 Linux - Software 1 11-21-2002 10:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration