Closed Wolvverine closed 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.
LF and/or CRLF should be used
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}
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(':')
Hi Wolvverine !
Please send me your device.conf for check.
With best regards, Denis Pavlov
I had storewize, not storwize. sorry.
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.