Solved

Set snmp on ESXi version 5.1

Posted on 2014-09-24
13
590 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 5
13 Comments
 
LVL 121
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 121
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 121
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 121
ID: 40341654
So, which do you want to use.....

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

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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Giving access to ESXi shell console is always an issue for IT departments to other Teams, or Projects. We need to find a way so that teams can use ESXTOP for their POCs, or tests without giving them the access to ESXi host shell console with a root …
Ransomware is a malware that is again in the list of security  concerns. Not only for companies, but also for Government security and  even at personal use. IT departments should be aware and have the right  knowledge to how to fight it.
Teach the user how to use vSphere Update Manager to update the VMware Tools and virtual machine hardware version Open vSphere Client: Review manual processes for updating VMware Tools and virtual hardware versions: Create a new baseline group in vSp…
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…

729 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