Page 1 of 1

Adding values for Warning and Critical

Posted: Tue Feb 01, 2022 6:21 am
by filip132
Hi everyone,

I am monitoring a guest VM on the VMWare host.

However, I would like to change values for any of the services related to VMWare guest, let's say for CPU, if CPU usage goes over 60% I would like to get a warning alert.

I couldn't find the option to change it. Any kind of help would be appreciated

Thanks

Re: Adding values for Warning and Critical

Posted: Wed Feb 02, 2022 11:45 am
by gsmith
Hi,

Could you please go to Config. Core Config Manager. Select Services, and edit one of the
"XXX CPU Usage" services. Please send me a screenshot of that page.

Thanks!

Re: Adding values for Warning and Critical

Posted: Wed Feb 02, 2022 4:12 pm
by filip132
Here is the screenshot:

Re: Adding values for Warning and Critical

Posted: Wed Feb 02, 2022 4:20 pm
by filip132
Also, under Check Command options, I couldn't quite find the "check_cpu" or any similar one that would indicate a potential command.

Forgot to take screenshots of these:

Re: Adding values for Warning and Critical

Posted: Thu Feb 03, 2022 4:48 pm
by ssax
Please see here:

https://nagios-plugins.org/doc/guidelin ... HOLDFORMAT

And the plugin help output:

Code: Select all

/usr/local/nagios/libexec/check_vmware_api.pl -h
-w, --warning=THRESHOLD
Warning threshold. See
https://nagios-plugins.org/doc/guidelin ... HOLDFORMAT
for the threshold format. By default, no threshold is set.
-c, --critical=THRESHOLD
Critical threshold. See
https://nagios-plugins.org/doc/guidelin ... HOLDFORMAT
for the threshold format. By default, no threshold is set.
So this should work:

Code: Select all

/usr/local/nagios/libexec/check_vmware_api.pl -H X.X.X.X -u 'username' -p 'password' -N 'VMNAME' -l CPU -s 'usage' -w 60
So you would edit your CPU service and change $ARG4$ to this:

Code: Select all

-l CPU -s 'usage' -w 60
Then Apply Configuration, force a check, and then let us know the results.

Re: Adding values for Warning and Critical

Posted: Thu Feb 03, 2022 5:42 pm
by filip132
There is the following error for the given links:
An error has been encountered in accessing this page.

1. Server: nagiosplug.sourceforge.io
2. URL path: /developer-guidelines.html
3. Error notes: NONE
4. Error type: 404
5. Request method: GET
6. Request query string: NONE
Correct me if I am being wrong, just want to clarify the current state.

The values for each of the arguments from:

Code: Select all

/usr/local/nagios/libexec/check_vmware_api.pl -H X.X.X.X -u 'username' -p 'password' -N 'VMNAME' -l CPU -s 'usage' -w 60
should be specified within the check_vmware_api.pl file or afterwards while editing service in the $ARG$ fields?

Because I see you gave the value of 60 for -w within the plugin file, so why would I need to specify it again in $ARG4$?

Also, is it necessary to add username and password within the plugins, if we already added VM host in Nagios?

Overall, I just want to know the logic behind this. Does it mean each virtual guest machine on VM host has to be modified through the terminal like from the example above, if we want to add certain value for notifications?

Thanks

Re: Adding values for Warning and Critical

Posted: Fri Feb 04, 2022 5:01 pm
by ssax

Re: Adding values for Warning and Critical

Posted: Fri Feb 04, 2022 5:10 pm
by ssax
Sorry, the commands I'm sending are meant to be tested from the CLI to make sure they work.

I made a mistake, follow this process:

Go to Configure > Core Config Manager > Services and edit your CPU service:
- Change $ARG4$ to this:

Code: Select all

-s 'usage' -w 60
Then Apply Configuration, force a check, and then let us know the results.

What that Core Config Manager change is implying is that you would need to edit the other CPU services to do the same if you wanted to alert on 60% usage being hit.

The -s 'usage' is telling the plugin that the warning threshold you're defining of -w 60) relates to usage for comparison. The plugin required it.

Re: Adding values for Warning and Critical

Posted: Thu Feb 10, 2022 4:31 am
by filip132
Thank you for the response.

Since I am left with couple more days of free trial, and haven't got my credentials yet for VMWare to configure it, I will continue with this thread once I purchase the license for Nagios XI, which should be expected soon.

Re: Adding values for Warning and Critical

Posted: Thu Feb 10, 2022 7:16 pm
by ssax
Okay, sounds good.

Once you get your credentials you can still run the check from the command line to validate it's working but to receive additional support you'll either need to purchase the license/support or work with sales to see if they can get you a trial extension.

Thank you!