Solved

Set snmp on ESXi version 5.1

Posted on 2014-09-24
13
558 Views
Last Modified: 2014-10-16
Hi all.

I have a monitoring server with IP address of 10.0.0.10 and am using a SNMP community name of Servers.
Using SSH to the ESXI hosts I am trying to set the community and trap destination but running into errors. I can get it enabled and show the community but can't get teh syntax right to add the trap destination. Any help appreciated.
0
Comment
Question by:Jason Thomas
  • 8
  • 5
13 Comments
 
LVL 119
ID: 40341543
didn't we do this before?

http://www.experts-exchange.com/Software/VMWare/Q_28513554.html

either use

vicfg-snmp.pl

or edit the XML file directly. (it's not supported, and VMware would rather you use the above command, but some Admins do it)
0
 
LVL 1

Author Comment

by:Jason Thomas
ID: 40341610
that wa vsphere client on 4.1 but as the question States im now using 5.1 and SSH connection.
Anyone any ideas?
0
 
LVL 119
ID: 40341613
It's the same procedure!

Your previous question was....

Set snmp on ESXi version 4.1, 5.1 and 5.5 ?

this question is

Set snmp on ESXi version 5.1?
please post the command, and output you are getting and the values you need, and community names.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 1

Author Comment

by:Jason Thomas
ID: 40341623
Yep, but the question concentrated on 4.1 and when i finally got that resolved I didn't think it fair to start asking for the 5.1 answer due to the original post getting so long...
0
 
LVL 119
ID: 40341640
(also still confused because previously you quoted)

(Hi Andrew. Yes, I looked at the link you sent and have successfully deployed SNMP on 5x versions. Just 4.1 outstanding.)

ANYWAY....

Well it's the same, you use the same commands, remotely.....

vicfg-snmp.pl

if you have an SSH connection, the only method is to edit the XML file, which is technically not a supported method or use the esxcli command which is new in 5.x.

see here

http://blogs.vmware.com/vsphere/2012/11/configuring-snmp-v1v2cv3-using-esxcli-5-1.html

It's the same procedure for 4.x, and 5.x, use the vicfg-snmp.pl
0
 
LVL 1

Author Comment

by:Jason Thomas
ID: 40341647
And I did try using vicfg from the client but get the following error and so resorted to SSH as now dealing with 5.1

C:\Program Files (x86)\VMware\VMware vSphere CLI\bin>vicfg-snmp.pl --server MyServer --username root IPAddress@162 -c MyCommunityName
Enter password:
Changing community list to: MyCommunityName...
Can't locate object method "fault_string" via package "Can't call method "Reconf
igureSnmpAgent" on an undefined value at C:\Program Files (x86)\VMware\VMware vS
phere CLI\bin\vicfg-snmp.pl line 241, <STDIN> line 1.
" (perhaps you forgot to load "Can't call method "ReconfigureSnmpAgent" on an un
defined value at C:\Program Files (x86)\VMware\VMware vSphere CLI\bin\vicfg-snmp
.pl line 241, <STDIN> line 1.
"?) at C:\Program Files (x86)\VMware\VMware vSphere CLI\bin\vicfg-snmp.pl line 2
43, <STDIN> line 1.

End Disconnect
0
 
LVL 1

Author Comment

by:Jason Thomas
ID: 40341650
4.1 is working and i thought 5x was too but nope. It displays the community name correctly but not the trap destination
0
 
LVL 119
ID: 40341654
So, which do you want to use.....

SSH and esxcli or vicfg-snmp.pl ?
0
 
LVL 119
ID: 40341664
does this work ?

vicfg-snmp.pl --server hostname --username username --password password --show

and return

Current SNMP agent settings:
Enabled  : 0
UDP port : 161

Communities :

Notification targets :

Options :
EnvEventSource=indications
loglevel=info
0
 
LVL 119
ID: 40341684
C:\Program Files (x86)\VMware\VMware vSphere CLI\bin>

vicfg-snmp.pl --server 192.168.1.50 --username root --password donald -c public -t 192.168.1.1/public

Changing community list to: public...
Complete.
Changing notification(trap) targets list to: 192.168.1.1/public...
Complete.

C:\Program Files (x86)\VMware\VMware vSphere CLI\bin>

if the pl script is not running, use the escli at the console.
0
 
LVL 1

Author Comment

by:Jason Thomas
ID: 40341782
I can;t use vicfg-snmp.pl from the client as I get the error above and i get this for all 4 hosts.
If i try using esxcli from SSH it just errors stating no such option --server.

All i need is the syntax from SSH to add a community name of "Inf_System" to a target address of 10.0.0.10

I try running "esxcli system snmp set -c Inf_System" And it returns "Community string was not specified in trap target 10.0.0.10.
So i run  "esxcli system snmp set -c Inf_Server -t 10.1.50.71/Inf_Server" and i get the same cr*ppy message

I've googled the hell out of it but can't get around the error.
0
 
LVL 119
ID: 40341831
It would appear, that the vicfg-snmp.pl is having issue setting the commands, it's possible you may have a different vCLI commands.

let me have a look.
0
 
LVL 119

Accepted Solution

by:
Andrew Hancock (VMware vExpert / EE MVE^2) earned 500 total points
ID: 40341964
if you issue the following does it work?

esxcli system snmp get

Open in new window


it should return....

/etc/vmware # esxcli system snmp get
   Authentication:
   Communities:
   Enable: false
   Engineid:
   Hwsrc: indications
   Loglevel: info
   Notraps:
   Port: 161
   Privacy:
   Remoteusers:
   Syscontact:
   Syslocation:
   Targets:
   Users:
   V3targets:

if it does not, I think your snmp.xml may be corrupted.

this works

esxcli system snmp set -c Int_System -t 10.0.0.10/Inf_System

Open in new window


/etc/vmware # esxcli system snmp get
   Authentication:
   Communities: Int_System
   Enable: false
   Engineid:
   Hwsrc: indications
   Loglevel: info
   Notraps:
   Port: 161
   Privacy:
   Remoteusers:
   Syscontact:
   Syslocation:
   Targets: 10.0.0.10@162 Inf_System
   Users:
   V3targets:
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Is your company's data protection keeping pace with virtualization? Here are 7 dynamic ways to adapt to rapid breakthroughs in technology.
When rebooting a vCenters 6.0 and try to connect using vSphere Client we get this issue "Invalid URL: The hostname could not parsed." When we get this error we need to do some changes in the vCenter advanced settings to fix the issue.
Teach the user how to convert virtaul disk file formats and how to rename virtual machine files on datastores. Open vSphere Web Client: Review VM disk settings: Migrate VM to new datastore with a thick provisioned (lazy zeroed) disk format: Rename a…
Teach the user how to edit .vmx files to add advanced configuration options Open vSphere Web Client: Edit Settings for a VM: Choose VM Options -> Advanced: Add Configuration Parameters:

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question