Solved

Set snmp on ESXi version 5.1

Posted on 2014-09-24
13
539 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 117
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 117
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 117
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

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

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

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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

#Citrix #XenApp #Citrix Scout #Citrix Insight Services #Microsoft VMMAP #Microsoft ADEXPLORE #Microsoft RAMMAP #Microsoft TCPVIEW #Microsoft AUTORUNS #Microsoft PROCESS EXPLORER #Microsoft PROCESS MONITOR
In this article, I will show you HOW TO: Create your first Windows Virtual Machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, the Windows OS we will install is Windows Server 2016.
Teach the user how to configure vSphere clusters to support the VMware FT feature Open vSphere Web Client: Verify vSphere HA is enabled: Verify netowrking for vMotion and FT Logging is in place or create it: Turn On FT for a virtual machine: Verify …
This video shows you how to use a vSphere client to connect to your ESX host as the root user. Demonstrates the basic connection of bypassing certification set up. Demonstrates how to access the traditional view to begin managing your virtual mac…

707 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

13 Experts available now in Live!

Get 1:1 Help Now