VMWare ESX variables for Integrate Nagios plugins

Hey Team,

I’m trying to create an ssh script that uses the user and password that is stored in VMWare ESX for vSphere rule.
In my Integrate Nagios plugins rule I have the below as the command line with the user and password hard coded.

sshpass -p 'SECRET' ssh -o StrictHostKeyChecking=no root@$HOSTADDRESS$ /opt/lsi/storcli/check_raid.sh

And it works, but I want to change the ‘SECRET’ and user ‘root’ to be the actual variables that are stored in the below.

vSphere User name: 	root
vSphere secret: 	Explicit, ******

Is the vSphere User name and vSphere secret stored as a variable that I can access from other scripts or rules ?

Many thanks in advance

Short answer “no”
For classic Nagios plugins you have only the possibility to user the user macros $USER5$ and so on or write the credentials as you shown as “hardcoded”.

I managed to create a custom host attribute and use that as a variable.
Seems to work OK.

Thanks

Name	esxi-pass
sshpass -p '$_HOSTESXI-PASS$' ssh -o

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.