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

Engage with the community of users including those using the open source solutions.
Includes Nagios Core, Plugins, and NCPA

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

Postby neospazzy » Sun Mar 24, 2019 6:36 am

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.
neospazzy
 
Posts: 1
Joined: Sat Mar 24, 2018 4:00 pm

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

Postby mcapra » Mon Mar 25, 2019 10:46 am

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
http://www.mcapra.com/
User avatar
mcapra
 
Posts: 3600
Joined: Thu May 05, 2016 3:54 pm

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

Postby tgriep » Mon Mar 25, 2019 2:08 pm

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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
 
Posts: 8655
Joined: Thu Oct 30, 2014 9:02 am


Return to Community Support

Who is online

Users browsing this forum: Google [Bot] and 15 guests