Solved

Set snmp on ESXi version 5.1

Posted on 2014-09-24
13
576 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 120
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 120
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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

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

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

HOW TO: Upload an ISO image to a VMware datastore for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5) using the vSphere Host Client, and checking its MD5 checksum signature is correct.  It's a good idea to compare checksums, because many installat…
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
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…

749 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