ESXi root has special passwords and Nagios isn't taking it

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
neospazzy
Posts: 1
Joined: Sat Mar 24, 2018 4:00 pm

ESXi root has special passwords and Nagios isn't taking it

Post by neospazzy »

So I created a password on my ESXi host that contains both a dollar sign and an exclamation. I modified the esxi config file. Here is a sample password that has both special characters.

Fakepa$s!

This is what I have for the service definitions.

define service{
use generic-service
host_name ESXi1
service_description ESXi Hardware Check
check_command check_esxi_hardware!root!Fakepa$s!!dell!--perfdata
}


That didn't work so I tried to use "Fakepa$s!" with quotes and 'Fakepa$s!' with single quotes and neither are working. They are coming back with "UNKNOWN: Authentication Error". I even went as far as putting both the single quotes inside the quotes to no avail.

"'FakePa$s!'"

I set up several Nagios boxes using check_esxi_hardware.py on other networks with "regular" passwords that has no special characters just fine so I know what I am doing. It is just this particular ESXi host that has a password that contains both these special characters are causing me headaches.

Any help is appreciated. Thanks.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: ESXi root has special passwords and Nagios isn't taking

Post by mcapra »

Here's the general purpose "special characters" KB article:
https://support.nagios.com/kb/article.php?id=580

I would suggest storing this password in a macro, then referencing that macro in your service definition. You can define custom macros in a resource file, then reference them in your Nagios Core objects.

An example might be to have the following line in your /usr/local/nagios/etc/resource.cfg file:

Code: Select all

$USER123$=Fakepa$s!
Which you can then reference in your service object like so:

Code: Select all

define service{
  use generic-service
  host_name ESXi1
  service_description ESXi Hardware Check
  check_command check_esxi_hardware!root!$USER123$!dell!--perfdata
}
Be sure to account for any CLI escaping that may be required, based on how your check_esxi_hardware command is defined.

Be sure to restart Nagios Core when you edit the resource.cfg file, or the service definition.
Former Nagios employee
https://www.mcapra.com/
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: ESXi root has special passwords and Nagios isn't taking

Post by tgriep »

Thanks @mcapra for the help.

@neospazzy, the exclamation mark is used as a delimiter in the Nagios commands so you would have to create a macro in the resource.cfg file to get it to work.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked