box293 Check not working on One Windows 2016 Server

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.
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

box293 Check not working on One Windows 2016 Server

Post by kwhogster »

Nagios 4.1
Windows 2016 DataCenter

Setup these checks and getting this error

CRITICAL: communication with the VMware API failed after 2 retries.

Code: Select all

define service {
        host_name               TGCS020-2016
        service_description     Guest CPU Usage
        check_command           box293_check_vmware_test!10.2.8.64!Guest_CPU_Usage!--guest!TGCS020-2016!!!!
        initial_state           u
        max_check_attempts      3
        check_interval          5
        retry_interval          3
        active_checks_enabled   1
        check_period            24x7
        servicegroups           VMCPULoad
        check_period            backup_WIN16
        notification_period     backup_WIN16
        register                1
        }
define service {
        host_name               TGCS020-2016
        service_description     Guest Snapshots
        check_command           box293_check_vmware_test!10.2.8.64!Guest_Snapshot!--guest!TGCS020-2016!--warning!snapshot_age:30!--critical!snapshot_age:45
        initial_state           u
        max_check_attempts      3
        servicegroups           nsclients
        check_interval          10080
        notification_interval   0
        retry_interval          7
        active_checks_enabled   1
        check_period            24x7
        servicegroups           VMSnapShots
        check_period            backup_WIN16
        notification_period     backup_WIN16
        register                1
        }

I have 20 other servers running Windows 2012 R2 and Windows 2016 and they all have the same code and they work

I checked the nsclient.ini on this server compared to another they are exactly the same I even copied the nsclient over from another server.

Any ideas on what to look for?

Thanks

Tom
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: box293 Check not working on One Windows 2016 Server

Post by npolovenko »

Hello, @kwhogster! Could you upload your plugin here? And, I'd like to see your command definition as well. Also, can you upload or pm me your nsclient.ini file?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: box293 Check not working on One Windows 2016 Server

Post by kwhogster »

Code: Select all

define command{
   command_name box293_check_vmware_test
   command_line $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H 10.2.8.7 -C "nice -n19 ~/box293_check_vmware.pl --server $ARG1$ --check $ARG2$ $ARG3$ $ARG4$ $ARG5$ $ARG6$ $ARG7$ $ARG8$"
}

attached the nsclient.ini

Not sure where I have the plugin will look for it.

Just a reminder I have many other VMs working with the same command and setup
Attachments
nsclient.ini
Nsclient
(22.05 KiB) Downloaded 536 times
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: box293 Check not working on One Windows 2016 Server

Post by tgriep »

The box293 plugin does not use NSClient++ to gather it's information, it uses the check_by_ssh plugin to run commands on a VMWare vMA server.

Can you run the following on the nagios server and post the output?

Code: Select all

/usr/local/nagios/libexec/check_by_ssh -E 1 -t 90 -l vi-admin -H 10.2.8.7 -C "nice -n19 ~/box293_check_vmware.pl --server 10.2.8.64 --check Guest_CPU_Usage --guest TGCS020-2016 --debug"
The debug option creates the file /home/vi-admin/box293_check_vmware_debug_log.txt on the vMA server so if the output does not print to the screen, you will have to retrieve the file from the vMA server and upload it to this post.

Thanks
Be sure to check out our Knowledgebase for helpful articles and solutions!
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: box293 Check not working on One Windows 2016 Server

Post by kwhogster »

I can not run the command because I can not ssh into the vma host.

I think the account is locked out of suse


I can go to the web page and logon as root and vi-admin but I can not ssh into the VMA host with root or vi-admin

Any ideas on how I can unlock this
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: box293 Check not working on One Windows 2016 Server

Post by tgriep »

I found this link for resetting the vi-admin password on the vMA server but I don't think that is the issue.
http://www.virten.net/2016/08/vma-6-rec ... omplexity/

What I think the cause is that the ssh certificates need to be re-created on the Nagios server and transferred to the vMA so the Nagios server can run the command without being prompted for a password.
In this manual
https://exchange.nagios.org/components/ ... 0&cf_id=29

Go to page 9 and on the bottom, you will see the instructions for creating the ssh certificates and re-transfer them to the vMA server should fix the issue for you.
Be sure to check out our Knowledgebase for helpful articles and solutions!
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: box293 Check not working on One Windows 2016 Server

Post by kwhogster »

tgriep

Thanks for the link I now have my root and vi-admin passwords reset


Now here are the results of the debug

Code: Select all

root@tgcs017:/usr/local/nagios/etc/objects# /usr/local/nagios/libexec/check_by_ssh -E 1 -t 90 -l vi-admin -H 10.2.8.7 -C "nice -n19 ~/box293_check_vmware.pl --server 10.2.8.64 --check Guest_CPU_Usage --guest TGCS020-2016 --debug"
Password:
Line 505 Script started @ Thu Oct  5 22:18:11 2017
Line 506 $current_version: '2016-05-10'
Line 507 $pre_flight_checks: '0'
Line 541 --check argument is supplied and is 'Guest_CPU_Usage', proceeding.
Line 555 --server argument is supplied and is '10.2.8.64', proceeding.
Line 572 Running Checks: '1'
Line 573 Total Checks: '0'
Line 574 Concurrent Checks: '15'
Line 588 Total number of concurrent checks NOT exceeded, proceeding.
Line 13076 $good_to_go_check: '0'
Line 12621 Thresholds_Test
Line 11503 SI_Test
Line 13108 $good_to_go_check == 0
Line 13109 About to connect
Line 13115 defined($connection
Line 13116 Connected
Line 10338 Perfdata_Option_Get
Line 13120 %Perfdata_Options: '0'
Line 10131 Modifiers_Get
Line 10185 @Modifiers_Supplied_Local: '0'
Line 13124 @Modifiers_Supplied_Global: '0'
Line 5878 Guest_Snapshot
Line 5880 $snapshot_request: 'Exclude Snapshot - Get'
Line 5892 option --exclude_snapshot was NOT set
Line 13128 @Exclude_Snapshot_Supplied: '0'
Line 13132 Running check: 'Guest_CPU_Usage'
Line 5811 Guest_Select
Line 5816 Guest_Select @target_properties: '5'
Line 5817 Guest_Select @target_properties values: 'summary.runtime.connectionState, summary.runtime.powerState, summary.quickStats, summary.config.numCpu, summary.runtime.host'
Line 5836 Guest_Select $target_guest_option provided via --guest: 'TGCS020-2016'
Line 10192 Modifiers_Process
Line 10194 $modifier_type: 'request'
Line 10198 $target_value: 'TGCS020-2016'
Line 10202 $modified_value: 'TGCS020-2016'
Line 10330 No request modifier defined, returning original value
CRITICAL: communication with the VMware API failed after 2 retries.
root@tgcs017:/usr/local/nagios/etc/objects#
Hope this helps you figure this out

Thanks

Tom
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: box293 Check not working on One Windows 2016 Server

Post by tgriep »

Thanks for the output, there is not much to work with but I checked the change log for the plugin and there were some fixes done to the perl script for the same error you are having.
Make sure you are running the latest box293_check_vmware.pl script on the vMA server and see if that fixes it.
Be sure to check out our Knowledgebase for helpful articles and solutions!
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: box293 Check not working on One Windows 2016 Server

Post by kwhogster »

Where can I get an up to date version?

And do you know the location of it on the vma host?

been looking for it can t seem to locate it will continue to try to find it


Update
I found the file it is located in this folder home/vi-admin


Question is why would all my other vm's work and only this does not?

I am thinking a config issue

Thoughts?

Tom
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: box293 Check not working on One Windows 2016 Server

Post by Box293 »

I've emailed @kwhogster a beta version of the plugin to see if this fixes the issue.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked