Hi,
Is it possible to monitor uptime for ESX host which is added in Nagios using vmware wizard (user name and password). If yes, how this can be done ?
Regards,
Preethu
uptime monitor for ESX host
Re: uptime monitor for ESX host
Please try this command against it:
See here for the -w or -c thresholds if you want to set them:
https://nagios-plugins.org/doc/guidelin ... HOLDFORMAT
Code: Select all
/usr/local/nagios/libexec/check_vmware_api.pl -H X.X.X.X -u 'youruser' -p 'yourpassword' -l "uptime"
https://nagios-plugins.org/doc/guidelin ... HOLDFORMAT
Re: uptime monitor for ESX host
Hi,
I tried the command but getting error. below are the screenshots, can you please check.
Regards,
Preethu
I tried the command but getting error. below are the screenshots, can you please check.
Regards,
Preethu
You do not have the required permissions to view the files attached to this post.
Re: uptime monitor for ESX host
Hello @preethu.d
Appears from the screenshot that the command is unable to read the Auth config let's make sure that the permissions are correct:
Then list it:
Let us know how that looks,
Perry
Appears from the screenshot that the command is unable to read the Auth config let's make sure that the permissions are correct:
Code: Select all
chown nagios:nagios <yourauthfile>
Code: Select all
ls -l
Perry
Re: uptime monitor for ESX host
Hi Perry,
I have made the changes. But still getting the same error.
For this ESX host, auth file was in the below path.
/usr/local/nagiosxi/etc/components/vmware/
earlier it was "apache nagios", after changing permission it is showing as "nagios nagios"
I did a run check command after making the changes, but it was giving the same error.
Regards,
Preethu
I have made the changes. But still getting the same error.
For this ESX host, auth file was in the below path.
/usr/local/nagiosxi/etc/components/vmware/
earlier it was "apache nagios", after changing permission it is showing as "nagios nagios"
I did a run check command after making the changes, but it was giving the same error.
Regards,
Preethu
Re: uptime monitor for ESX host
If you look at the command from your screenshot at the top you see this defined:
The -f option is to point to an auth file:
Taken from the plugin help output:
So what the nagios process will do is replace the $MACRONAME$ macros in the command you have selected with the actual values before running them.
So with everything in $ARG1$ the command would translate to this which isn't proper:
- $USER1$ = Taken from /usr/local/nagios/etc/resource.cfg and points to /usr/local/nagios/libexec
- $HOSTADDRESS$ = Will use the hosts Address field that the service is attached to
- $ARG1$ = -u 'username' -p 'password' -l "uptime"
Go edit to the service in Configure > Core Config Manager > Commands and set the $ARGn$ values based on the command that it's using:
So you would want:
$ARG1$ = /usr/local/nagios/libexec/your_auth_file
$ARG2$ = uptime
Then click Save, Apply Configuration, and Force a check to see if it is now working and let us know the results.
Code: Select all
$USER1$/check_vmware_api.pl -H "$HOSTADDRESS$" -f "$ARG1$" -l "$ARG2$" $ARG3$
Code: Select all
-f, --authfile=<path>
Authentication file with login and password. File syntax :
username=<login>
password=<password>
Code: Select all
/usr/local/nagios/libexec/check_vmware_api.pl
So with everything in $ARG1$ the command would translate to this which isn't proper:
- $USER1$ = Taken from /usr/local/nagios/etc/resource.cfg and points to /usr/local/nagios/libexec
- $HOSTADDRESS$ = Will use the hosts Address field that the service is attached to
- $ARG1$ = -u 'username' -p 'password' -l "uptime"
Code: Select all
/usr/local/nagios/libexec/check_vmware_api.pl -H "X.X.X.X" -f "-u 'username' -p 'password' -l "uptime"" -l ""
Code: Select all
$USER1$/check_vmware_api.pl -H "$HOSTADDRESS$" -f "$ARG1$" -l "$ARG2$" $ARG3$
$ARG1$ = /usr/local/nagios/libexec/your_auth_file
$ARG2$ = uptime
Then click Save, Apply Configuration, and Force a check to see if it is now working and let us know the results.
Re: uptime monitor for ESX host
Hi,
Thanks for the help, it is working. You can lock the thread.
Regards,
Preethu
Thanks for the help, it is working. You can lock the thread.
Regards,
Preethu