BaldMansMojo / check_vmware_esx

chech_vmware_esx Fork of check_vmware_api.pl
GNU General Public License v2.0
124 stars 67 forks source link

check tools output "Installed,running,but not managed by VMWare" although open_vm_tools_ok is set #168

Closed diLLec closed 2 years ago

diLLec commented 4 years ago

If just one other bad state is detectd, the VM ... Installed,running,but not managed by VMWare. messages are outputted as well and may confuse the user.

For example:

WARNING: 21 VMs checked for VMWare Tools state, 0 are not OK.
1 Installed,running and current.
1 Installed,running,version is not current
19 Installed,running,but not managed by VMWare
VM ... Installed,running,but not managed by VMWare.
VM ... Installed,running,but not managed by VMWare.
VM ... Installed,running,but not managed by VMWare.
VM ... Installed,running,but not managed by VMWare.
VM ... Installed,running,but not managed by VMWare.
VM ... Installed,running,but not managed by VMWare.
VM ... Installed,running,but not managed by VMWare.
VM ... Installed,running,but not managed by VMWare.
VM ... Installed,running,but not managed by VMWare.
VM ... Installed,running,but not managed by VMWare.
VM ...Installed,running,but not managed by VMWare.
VM ... Installed,running,version is not current.
VM ... Installed,running,but not managed by VMWare.

The bad state, which is causing the issue is VM ... Installed,running,version is not current.

Problem could be solved here: https://github.com/BaldMansMojo/check_vmware_esx/blob/37d222ec9a2b662eeb41fe1ae1cce49d0db6dac1/modules/dc_runtime_info.pm#L511

By changing the code as follows:

                                 if (defined($openvmtools))
                                    {
                                    $actual_state = 0;
                                    }
                                 else
                                    {
                                    $actual_state = 1;
                                    $tools_out = $tools_out . "VM " . $vm->name . " ($openvmtools) Installed,running,but not managed by VMWare. " . $multiline;
                                    }
BaldMansMojo commented 2 years ago

This had been fixed by the option above.