Yogibaer75 / Check_MK-Things

From check plugins to website extensions
60 stars 19 forks source link

powerfault me4 Plugin crashes with me4012 and cmk2.0.0p23 #15

Closed d3sh0m3d closed 2 years ago

d3sh0m3d commented 2 years ago

Hey, got some crashes with the plugin. Here are some logs:

Agent exited with code 1: Traceback (most recent call last): File "/omd/sites/###/lib/python3/urllib3/connection.py", line 174, in _new_conn conn = connection.create_connection( File "/omd/sites/###/lib/python3/urllib3/util/connection.py", line 96, in create_connection raise err File "/omd/sites/###/lib/python3/urllib3/util/connection.py", line 86, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/omd/sites/###/lib/python3/urllib3/connectionpool.py", line 699, in urlopen httplib_response = self._make_request( File "/omd/sites/###/lib/python3/urllib3/connectionpool.py", line 382, in _make_request self._validate_conn(conn) File "/omd/sites/###/lib/python3/urllib3/connectionpool.py", line 1010, in _validate_conn conn.connect() File "/omd/sites/###/lib/python3/urllib3/connection.py", line 358, in connect conn = self._new_conn() File "/omd/sites/###/lib/python3/urllib3/connection.py", line 186, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7fe1c288bd90>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/omd/sites/###/lib/python3/requests/adapters.py", line 439, in send resp = conn.urlopen( File "/omd/sites/###/lib/python3/urllib3/connectionpool.py", line 755, in urlopen retries = retries.increment( File "/omd/sites/###/lib/python3/urllib3/util/retry.py", line 574, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='10.141.110.248', port=443): Max retries exceeded with url: /api/login/d29449d95069cce7e53bca8bfe47b12f1503c954f54365ce5a12950d6b14416e (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fe1c288bd90>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/omd/sites/###/local/share/check_mk/agents/special/agent_dellpowervault", line 67, in sys.exit(main()) File "/omd/sites/###/local/share/check_mk/agents/special/agent_dellpowervault", line 53, in main r = s.get(url + "/api/login/" + auth_string, verify=False) File "/omd/sites/###/lib/python3/requests/sessions.py", line 555, in get return self.request('GET', url, kwargs) File "/omd/sites/###/lib/python3/requests/sessions.py", line 542, in request resp = self.send(prep, send_kwargs) File "/omd/sites/###/lib/python3/requests/sessions.py", line 655, in send r = adapter.send(request, **kwargs) File "/omd/sites/###/lib/python3/requests/adapters.py", line 516, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='10.141.110.248', port=443): Max retries exceeded with url: /api/login/d29449d95069cce7e53bca8bfe47b12f1503c954f54365ce5a12950d6b14416e (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fe1c288bd90>: Failed to establish a new connection: [Errno 111] Connection refused'))

Yogibaer75 commented 2 years ago

Was it working before? As you get a connection refused error. That means that most possible your credentials are wrong. What version of the mkp do you use?

d3sh0m3d commented 2 years ago

No I just found a plugin for the powerfault here, I used the mkp version 2.5. Tried different credentials for the plugin but none is working. Is there any service i need to enable in the powerfault? Like SMI-S or something?

Yogibaer75 commented 2 years ago

One other thing is the firmware of your ME4. Some days before i made a change on the special agent to support newer versions of the ME4 firmware. You can try to change this back to the old behavior.

modify the agent_dellpowervault like this

    url = "https://" + args.hostaddress
+    auth_string = hashlib.md5("{}_{}".format(
-    auth_string = hashlib.sha256("{}_{}".format(
    args.username, args.password).encode("utf-8")).hexdigest()

You see that you only need to replace the actual sha356 with the old md5. If your ME4 works after the change then you should update the firmware of your device to a newer version.

d3sh0m3d commented 2 years ago

Just tried to change the hashlib to md5 but still get the same error

Yogibaer75 commented 2 years ago

Then i cannot help directly. But you can have a look here at the Dell documentation of the API. https://www.dell.com/support/manuals/de-de/powervault-me4024/me4_series_cli_pub/using-a-script-to-access-the-cli?guid=guid-9ae5ccd6-a207-42df-b2f3-1e02a487a354&lang=en-us Keep in mind that you need web access from the monitoring to the Dell system.

d3sh0m3d commented 2 years ago

Ok now I saw the problem, thanks for your tip with the web access, tried a curl and get a "access denied". Now open the port on the firewall and it works now. Thanks a lot.

Yogibaer75 commented 2 years ago

Firewall problem 😃