Problem enabling SNMP on ESXi 4.1

-m03dinhas-
-m03dinhas- used Ask the Experts™
on
Hi Guys

I am trying to enable SNMP on an ESXi 4.1 box.

So far I have edited the /etc/vmware/snmp.xml file as below:

<config>
        <snmpSettings>
                <enable>true</enable>
                <comunities>public</comunities>
                <targets>127.0.0.1@161 public</targets>
        </snmpSettings>
</config>

After saving the file I restarted the services using "services.sh restart" command

These settings do not seem to be working, could someone please help?

Thanks a lot

Joao
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
that looks, correct, did you save as snmp.xml

try restarting the host.

Do you have the FREE version of ESXi, because this is not available.

You can test with the vCLI

vicfg-snmp –server ESXISERVERIP –T

Author

Commented:
Thanks for your reply,

We are using a Vsphere STD license on this, hence my question.

I will try a server reboot as soon as possible and reply back

Thanks
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
Check with the vCli commands


vicfg-snmp –server ESXISERVERIP –T
Success in ‘20 With a Profitable Pricing Strategy

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
I just installed vCLI and it doesnt seem to recognize any of the commands?

What am I doing wrong? Its probably something silly

Author

Commented:
It was someting silly :)

I got the below output

C:\Program Files (x86)\VMware\VMware vSphere CLI\bin>vicfg-snmp.pl -server <ip> -T
Enter username: <user>
Enter password:
Sending test nofication(trap) to all configured targets...
Failed : A general system error occurred: Agent is not enabled

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

Author

Commented:
Tried to enable using:

C:\Program Files (x86)\VMware\VMware vSphere CLI\bin>vicfg-snmp.pl -server <ip> -E
Enter username: root
Enter password:
Enabling agent...
Failed : A general system error occurred: Load persistant store failed
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
C:\Program Files (x86)\VMware\VMware vSphere CLI\bin>vicfg-snmp.pl -server esx002 -T
Enter username: root
Enter password:
Sending test nofication(trap) to all configured targets...
Failed : A general system error occurred: Agent is not enabled

I get this against a ESXi 4.1 U0 disabled ESX host.

Sometimes, the vCLI can act strangely on some PCs for without reason.
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
ah, okay I've just seen the other post. So vCLI is working.

Author

Commented:
I just restarted the box and the behaviour is the same. Even our monitoring system cant pick it up using SNMP

I will pick this up again tomorrow morning.

Thanks for your help
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
what do you get if you do

C:\Program Files (x86)\VMware\VMware vSphere CLI\bin>vicfg-snmp.pl -server esx002 -s
Enter username: root
Enter password:
Current SNMP agent settings:
Enabled  : 0
UDP port : 161
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
Setting the Community Name

C:\Program Files (x86)\VMware\VMware vSphere CLI\bin>vicfg-snmp.pl -server esx002 -c public
Enter username: root
Enter password:
Changing community list to: public...
Complete.

Enabling the Agent

C:\Program Files (x86)\VMware\VMware vSphere CLI\bin>vicfg-snmp.pl -server esx002 -E
Enter username: root
Enter password:
Enabling agent...
Complete.

Show status

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

C:\Program Files (x86)\VMware\VMware vSphere CLI\bin>vicfg-snmp.pl -server esx002 -s
Enter username: root
Enter password:
Current SNMP agent settings:
Enabled  : 1
UDP port : 161

Communities :
public

Notification targets :

C:\Program Files (x86)\VMware\VMware vSphere CLI\bin>
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
Don't forget to send trap destinations with -t also.
Try another comunitie name.
Then try to connect with MIB walk ( you can find it on SolarWinds Engineer's Toolset )
If you change the comunitie name, restart services.sh.

Let me know of this works

Author

Commented:
Hi guys,

Thanks for your suggestions. I will get started on this tomorrow morning and let you know the outcome as soon as possible

Thanks for the help

Joao
Hi Guys,

It seems problem is now fixed :)

Apparently the xml file was corrupt. I renamed it and created a new one with the below content

<config>
<snmpSettings>
<communities>public</communities>
<enable>true</enable>
</snmpSettings>
</config>

I then restarted the services

ran vicfg-snmp.pl -server <IP> -s

And verified SNMP was enabled.

Tested it with the monitoring system and all seems to be fine.

Thanks a lot for the help guys :) much appreciated

Joao
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
"After investigating error: "A general system error occurred: Load persistant store failed", found the SNMP.xml file was corrput and fixed the issue as described on my last post.

Verified following suggestions from Hanccocka with thanks"


I'm objecting to closure of the question on the following grounds.

If you followed my advice, as per your closing statement, if you found the post helpful you should award points.

Author

Commented:
With all due respect, the only reason why no points have been assigned on this instance is only because although your post was most helpful to verify SNMP was in fact enabled, it didnt help enabling it. What did help was the recreation of the XML file, and this answer I managed to find on line. As I wouldnt assign points to myself for having found it, I figured the best course of action was to not assign any point to anyone on the thread.

I believe points shoudl be given to the post that actually has the solution to the problem, so not to mislead other readers that could be looking there for the solution.

Joao

Author

Commented:
Modalot

Thank you for your comment. Much appreciated. I did feel that marking my post as the solution was the right thing to do, but also wanted to avoid creating a "bad vibe" within the community, and for that I apologize.

Thank you for stepping in and help do the right thing, it feels good to know you guys do monitor these threads which just shows how credible and useful this forum really is.

Joao

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial