Nutanix device monitoring

Yes i think this can be fixed. The problem here is that i only modified the original agent to output the new data.
The alerts part are from the original agent. In the latest CMK versions this part was changed and the actual check cannot work with my old output format :frowning:

If i have a little bit time the next days, you should have a test build in one or two days.

That would realy be great. Thank you for looking at it.

I made an actual version of the Nutanix enhanced monitoring.

I had no time to test on a 2.0 instance. It is only tested on 2.1
It is now also possible to configure the wanted/expected VM state on the Nutanix.

Thank you! The Prism Alerts are working again.

Hi Andreas, We found a small bugg in the way large filesystems are being graphed. The size of the volumes is in Tb (that is correct) but the graph show the volume in Mb’s (incorrect). I contacted CheckMK support but they tell me the problem is in the custom mkp file. Can you have a look and perhaps fix this small problem?

Qickfix without installing a new mkp.
~/local/share/check_mk/web/plugins/metrics/prism.py
add the two lines

check_metrics["check_mk-prism_containers"] = df_translation
check_metrics["check_mk-prism_storage_pools"] = df_translation

restart Apache and that’s it

That is quick! And it works! Will you include this in a future release?

In the meantime, I uploaded the latest version of the mkp and got this error:

Ups it looks like a 2.0 vs. 2.1 CMK problem.
Yesterday i already build a 2.1 mkp with the latest changes but not for 2.0.

He Andreas. I have check-mk-raw-2.1.0p2 on Debian Bullseye.
I just install nutanix_prism-3.6-2.0.mkp on it.
Here the result I get in connection tests :
ERROR [special_prism]: Agent exited with code 1: Caught unhandled HTTPError(HTTP Error 412: PRECONDITION FAILED) in /omd/sites/vic/lib/python3/cmk/special_agents/utils/agent_common.py:135

Before installation, the integrated Prism monitoring was working fine.

Did I something wrong ? Should I open an issue in Issues · Yogibaer75/Check_MK-Things · GitHub ?
Thanks.

This package is not for 2.1 - please remove the mkp and test with
https://github.com/Yogibaer75/Check_MK-Things/blob/master/check%20plugins%202.1/nutanix/nutanix_prism-3.7-2.1.mkp
It would be also good to update the CMK itself as 2.1.0p2 is a old version with many changes since than.

My bad.
Here is the new result :

Agent exited with code 1: Traceback (most recent call last):
File “/omd/sites/vic/share/check_mk/agents/special/agent_prism”, line 7, in
from cmk.special_agents.agent_prism import main
File “/omd/sites/vic/local/lib/python3/cmk/special_agents/agent_prism.py”, line 20, in
def parse_arguments(argv: Sequence[str] | None) → Args:
TypeError: unsupported operand type(s) for |: ‘types.GenericAlias’ and ‘NoneType’

I’ll take a look to CMK upgrade.

I have upgraded to 2.1.0p17.cre

But no change :

ERROR [special_prism]: Agent exited with code 1: Traceback (most recent call last):
File “/omd/sites/vic/share/check_mk/agents/special/agent_prism”, line 7, in
from cmk.special_agents.agent_prism import main
File “/omd/sites/vic/local/lib/python3/cmk/special_agents/agent_prism.py”, line 20, in
def parse_arguments(argv: Sequence[str] | None) → Args:
TypeError: unsupported operand type(s) for |: ‘types.GenericAlias’ and ‘NoneType’

This is a problem between Python version inside 2.1 and master branch. As i build the last agent against the master branch this was introduced there.

To fix this, please change line 20 inside
/omd/sites/vic/local/lib/python3/cmk/special_agents/agent_prism.py
from

def parse_arguments(argv: Sequence[str] | None) → Args:

to

def parse_arguments(argv: Optional[Sequence[str]]) -> Args:

Inside the import statements please also add the line

from typing import Optional

I will build a fixed package the next days.

I made a new version for 2.1

Hi Andreas.
I installed the new version 3.8-2.1.
But it fails for another reason :
ERROR [special_prism]: Agent exited with code 1: Caught unhandled HTTPError(HTTP Error 412: PRECONDITION FAILED) in /omd/sites/vic/lib/python3/cmk/special_agents/utils/agent_common.py:135

This looks more like an connection problem to your Nutanix Prism instance.
Can you have a look if you execute the special agent manually on the command line if there is a little bit more error message.

The HyperText Transfer Protocol (HTTP) 412 Precondition Failed client error response code indicates that access to the target resource has been denied.

Hi Andreas,
it is already the output in CLI
Indeed, the basic Nutanix integration is working fine ( configured with Nutanix Prism> SetupAgents>Other integrations>Nutanix Prism).
When your package is used instead, should I configure authentication somewhere else ?

Do you get any output on the command line or instant the error message?
Yesterday i uploaded a new version with some new checks but without any changes at the special agent.

Here is the complete sequence :
OMD[mysite]:~$ cmk -P install nutanix_prism-3.8-2.1.mkp
OMD[mysite]:~$ cmk -P enable nutanix_prism 3.8-2.1
OMD[mysite]:~$ cmk -d myprismcentral.mydomain
Failed to auto-migrate legacy plugin to check plugin: prism_alerts
Please refer to Werk 10601 for more information.
Failed to auto-migrate legacy plugin to check plugin: prism_containers
Please refer to Werk 10601 for more information.
Failed to auto-migrate legacy plugin to check plugin: prism_info
Please refer to Werk 10601 for more information.
Failed to auto-migrate legacy plugin to check plugin: prism_storage_pools
Please refer to Werk 10601 for more information.
ERROR [special_prism]: Agent exited with code 1: Caught unhandled HTTPError(HTTP Error 412: PRECONDITION FAILED) in /omd/sites/vic/lib/python3/cmk/special_agents/utils/agent_common.py:135

OMD[mysite]:~$ cmk -P disable nutanix_prism
OMD[mysite]:~$ cmk -P remove nutanix_prism 3.8-2.1
OMD[mysite]:~$ cmk -d myprismcentral.mydomain
<<<prism_containers:sep(124)>>>
name|usage|capacity
DATASTORE-PROD|122996541440|20185483938585
DATASTORE-QUAL|0|20062487397145
SelfServiceContainer|6729007104|20069216404249
NutanixManagementShare|8886212608|20071373609753
DATASTORE-DEV|0|20062487397145
DATASTORE-ADMIN|67993247744|20130480644889
<<<prism_alerts:sep(0)>>>
[“timestamp”, “severity”, “message”, “context”]
[1670450412151595, “kWarning”, “Detected iSCSI discovery through cluster external IP address”, {}]
[1670450402938588, “kWarning”, “VSS snapshot is not supported for the VM ‘PrismCentral’, because NGT VSS capability is not enabled for VM.”, {}]
[1670337299255575, “kCritical”, “Please update the default password on PC for user(s): nutanix to harden the security on the clusters. Nutanix highly recommends not using default passwords for clusters.”, {}]
<<<prism_info:sep(124)>>>
name|version
Unnamed|6.1
<<<prism_storage_pools:sep(124)>>>
name|usage|capacity
default-storage-pool-24980346337446|413210017792|40538184812082

This is not what i mean with execute the agent manually on command line.
After you installed the mkp and configured the host you can get the command with “cmk -D myprismcentral.mydomain” → line program

But what you can also do is go to the folder “~/local/lib/check_mk/special_agents/”
There should be one file → “agent_prism.py”
Execute this as test with python3 agent_prism.py --server IP/name --username monitoringuser --password monpassword
This must work - you can add the options “-v” and “-d” for a little bit more output.