Solved

Set snmp on ESXi version 5.1

Posted on 2014-09-24
13
550 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 118
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 118
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
 
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 118
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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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 118
ID: 40341654
So, which do you want to use.....

SSH and esxcli or vicfg-snmp.pl ?
0
 
LVL 118
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 118
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 118
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 118

Accepted Solution

by:
Andrew Hancock (VMware vExpert / EE MVE) 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

When converting a physical machine to a virtual machine using VMware vCenter Converter Standalone or vCenter Converter Enterprise, if an adapter type is not selected during the initial customization the resulting virtual machine may contain an IDE d…
If your vDisk VHD file gets deleted from the image store accidentally or on purpose, you won't be able to remove the vDisk from the PVS console. There is a known workaround that is solid.
Teach the user how to delpoy the vCenter Server Appliance and how to configure its network settings Deploy OVF: Open VM console and configure networking:
Teach the user how to use configure the vCenter Server storage filters Open vSphere Web Client:  Navigate to vCenter Server Advanced Settings: Add the four vCenter Server storage filters: Review the advanced settings: Modify the values of the four v…

920 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now