pavlovdo / pystormon

Zabbix storage monitoring via CIM/WBEM
16 stars 8 forks source link

Only first position in devices.conf file is checking #13

Closed Wolvverine closed 3 years ago

Wolvverine commented 3 years ago

Only first position in devices.conf file is checking:

storwize:STORAGE-1-192.168.1.1:192.168.1.1 storwize:STORAGE-2-192.168.1.2:192.168.1.2 storwize:STORAGE-3-192.168.1.3:192.168.1.3 storwize:STORAGE-4-192.168.1.4:192.168.1.4

and if you change order, script remeber first position.

pavlovdo commented 3 years ago

Hi, Wolvverine !

All lines in device file is reading if you have correct file with several lines divided by '\n'. And i added closing of file in the end of scripts, please check now.

Wolvverine commented 3 years ago

LF and/or CRLF should be used

Wolvverine commented 3 years ago

Situation is the same:

[root@zabbix pystormon]# /usr/lib/zabbix/externalscripts/pystormon/storage_objects_discovery.py STORAGE-1-192.168.1.1 arrays.discovery {"data": []} STORAGE-1-192.168.1.1 diskdrives.discovery {"data": []} STORAGE-1-192.168.1.1 enclosures.discovery {"data": [{"{#SO_TYPE}": "Enclosure", "{#SO_NAME}": "99"}]} STORAGE-1-192.168.1.1 mdisks.discovery {"data": []} STORAGE-1-192.168.1.1 mdiskgrps.discovery {"data": [{"{#SO_TYPE}": "mdiskgrp", "{#SO_NAME}": "Pool0"}]} STORAGE-1-192.168.1.1 systems.discovery {"data": [{"{#SO_TYPE}": "System", "{#SO_NAME}": "V7000-SERVICE"}]} STORAGE-1-192.168.1.1 vdisks.discovery {"data": []} Status of sending data to zabbix: {"processed": 7, "failed": 0, "total": 7, "time": "0.000124", "chunk": 1}

Wolvverine commented 3 years ago

Add readlines for device config file:

device_list_file = open(nd_parameters['device_file'])
device_list_lines= device_list_file.readlines()

# unpack storage list to variables
for device_line in device_list_lines:
    device_type, device_name, device_ip = device_line.split(':') 
pavlovdo commented 3 years ago

Hi Wolvverine !

Please send me your device.conf for check.

With best regards, Denis Pavlov

Wolvverine commented 3 years ago

I had storewize, not storwize. sorry.