ktelep / EMC-Zabbix-Integration

Integration for Zabbix and the EMC ECOM server for VNX1/VNX2 Monitoring
MIT License
35 stars 13 forks source link

Errors.. #3

Closed jorisboth closed 8 years ago

jorisboth commented 8 years ago

I've been struggling to get this running.

I first got error messages with the WBEMConnection connection that SSL verification failed. I fixed this by adding the "no_verification=True" to the connection string, making it as followed:

pywbem.WBEMConnection(ecom_url, (ecom_user, ecom_pass), default_namespace="/root/emc", no_verification=True)

I changed every entry i found in both scripts and the ECOM script under the tools directory. After that, I was able to add my EMC.

The discovery script works fine when I ran it manually as followed:

/emc_vnx_discovery.py --serial --ecom_ip 10.0.2.23 --ecom_user admin --ecom_pass "#1Password" --procs

But when I try to run the stats script manually with the command below, it fails. ./emc_vnx_stats.py --serial --ecom_ip 10.0.2.23 --ecom_user admin --ecom_pass "#1Password" -o

The error message is:

Traceback (most recent call last): File "./emc_vnx_stats.py", line 613, in main() File "./emc_vnx_stats.py", line 601, in main args.ecom_user, args.ecom_pass) File "./emc_vnx_stats.py", line 312, in pool_stats_query "-s", array_serial, "-T", "-i", stat_file]) File "/usr/lib/python2.7/subprocess.py", line 493, in call return Popen(_popenargs, *_kwargs).wait() File "/usr/lib/python2.7/subprocess.py", line 679, in init errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1259, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory

When I look at the latest data in Zabbix, I see the following error message:

Traceback (most recent call last): File "/usr/lib/zabbix/externalscripts/emc_vnx_stats.py", line 613, in main() File "/usr/lib/zabbix/externalscripts/emc_vnx_stats.py", line 597, in main args.ecom_user, args.ecom_pass) File "/usr/lib/zabbix/externalscripts/emc_vnx_stats.py", line 218, in sp_stats_query ecom_user, ecom_pass) File "/usr/lib/zabbix/externalscripts/emc_vnx_stats.py", line 116, in get_stats interval = get_sample_interval(ecom_conn, array_serial) File "/usr/lib/zabbix/externalscripts/emc_vnx_stats.py", line 83, in get_sample_interval array = get_array_instancename(ecom_conn, array_serial) File "/usr/lib/zabbix/externalscripts/emc_vnx_stats.py", line 63, in get_array_instancename registered_arrays = ecom_conn.EnumerateInstanceNames("Clar_StorageSystem") File "/usr/local/lib/python2.7/dist-packages/pywbem-0.8.0rc3-py2.7.egg/pywbem/cim_operations.py", line 927, in EnumerateInstanceNames **params) File "/usr/local/lib/python2.7/dist-packages/pywbem-0.8.0rc3-py2.7.egg/pywbem/cim_operations.py", line 593, in imethodcall timeout=self.timeout) File "/usr/local/lib/python2.7/dist-packages/pywbem-0.8.0rc3-py2.7.egg/pywbem/cim_http.py", line 558, in wbem_request raise AuthError(response.reason) pywbem.cim_http.AuthError: Authorization Required

The Authorization required error should indicate that the macro's are missing or invalid, but they aren't..

Any ideas?

ktelep commented 8 years ago

Doublecheck that you have set an {$ECOMUSER} and {$ECOMPASS} macro for the Host entry, there was a code update that required this however the README.md did not reflect this requirement.

As far as why it's failing when you run it manually, check the sender_command variable on line 16 is the correct path to the zabbix_sender command.

I'll add an update to the code to check that it exists and give an actual error if it cannot be found.

ktelep commented 8 years ago

Can you also confirm for me what OS your Zabbix server is running under. The no_verification parameter should not be required, and I'd like to try and test to see if it's an OS/distribution specific issue.

ktelep commented 8 years ago

Added zabbix_sender and agentd.conf checks in commit 0571299

Refactored code to single WBEM connection in commit 3b51c534d4e8b4387f429ea6f7ea03b05f4f0628

jorisboth commented 8 years ago

The file path to the zabbix_sender was indeed wrong, just as the file path of the zabbix_agentd.conf file. I've adjusted it and now the output looks like this:

root@Zabbix:/usr/lib/zabbix/externalscripts# ./emc_vnx_stats.py --serial CKM00134300382 --ecom_ip 10.0.2.23 --ecom_user admin --ecom_pass "#1Password" --pools info from server: "processed: 0; failed: 5; total: 5; seconds spent: 0.000102" sent: 5; skipped: 0; total: 5 CKM00134300382 emc.vnx.perf.TotalManagedSpace[CLARiiON+CKM00134300382+U+Pool_0] 1452236959 18394694811648 CKM00134300382 emc.vnx.perf.RemainingManagedSpace[CLARiiON+CKM00134300382+U+Pool_0] 1452236959 0 CKM00134300382 emc.vnx.perf.EMCPercentSubscribed[CLARiiON+CKM00134300382+U+Pool_0] 1452236959 100 CKM00134300382 emc.vnx.perf.EMCSubscribedCapacity[CLARiiON+CKM00134300382+U+Pool_0] 1452236959 18400074006528 CKM00134300382 emc.vnx.perf.EMCEFDCacheEnabled[CLARiiON+CKM00134300382+U+Pool_0] 1452236959 False

Any idea why it shows failed: 5?

I'm running debian vresion 7.9 with kernel Linux Zabbix 3.2.0-4-amd64 #1 SMP Debian 3.2.68-1+deb7u6 x86_64

jorisboth commented 8 years ago

I've double checked the macro's in the config, but they do seem to be OK.. capture Edit Never mind, found the typo in the password :)

jorisboth commented 8 years ago

It's working!!!! Thank you soooooo much! Finally I can monitor my storage system.

ktelep commented 8 years ago

Awesome! Please keep an eye on here as I'm still regularly updating code and adding additional metrics/features.

I do still have concern about the SSL issue. I fired up a Debian 7.9 VM to see if I can recreate it and I am unable to. Is your connection to the ECOM server going through a proxy or something that may be getting in the middle?

vagrant@debian-wheezy:~$ uname -a
Linux debian-wheezy 3.2.0-4-amd64 #1 SMP Debian 3.2.68-1+deb7u6 x86_64 GNU/Linux
vagrant@debian-wheezy:~$ python
Python 2.7.3 (default, Mar 13 2014, 11:03:55)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pywbem
>>> ecom_conn = pywbem.WBEMConnection('https://10.5.36.50:5989', ('admin','#1Password'),default_namespace="root/emc")
>>> ecom_conn.EnumerateInstances("Clar_StorageSystem")
[CIMInstance(classname=u'Clar_StorageSystem', ...), CIMInstance(classname=u'Clar_StorageSystem', ...)]
>>>
vagrant@debian-wheezy:~$ dpkg -l | grep pywbem
ii  python-pywbem                      0.7.0-4                       all          Python WBEM Client and Provider Interface
vagrant@debian-wheezy:~$ dpkg -l | grep python
ii  python                             2.7.3-4+deb7u1                all          interactive high-level object-oriented language (default version)

Can you check the pyWBEM and python version for me to confirm we're doing an apples to apples comparison?

If someone runs into this in the future, here's answers to the other issues noted:

  1. If you run the stats command before discovery has completed, you'll see any keys that haven't yet been created by the discovery script as failed as they don't exist yet in Zabbix. This is expected.
  2. The default password is indeed a 1, not a !.... #! is muscle memory for many of us, but it indeed starts with #1....