mykolq / zabbix_lsi_template

Template is for discovering and monitoring LSI (Avago, Broadcom) storage controllers
13 stars 12 forks source link

zabbix_lsi_template for agent 2 module: lsi.pdlld and lsi.pdlld.ctl errors: cannot extract value from json by path "$["PhysicalDisks"]": no data matches the specified path #14

Closed YogSottot closed 1 month ago

YogSottot commented 1 month ago

Installed plugin https://github.com/mykolq/zabbix_agent2_plugins/releases Installed template: https://github.com/mykolq/zabbix_lsi_template/blob/agent2_module_template/LSI_Perc_Lenovo%20agent%202%20module.json

zabbix-server 7.0.2 zabbix-agent2 7.0.2

storcli64 --version
StorCli SAS Customization Utility Ver 007.2908.0000.0000 Mar 04, 2024

for lsi.pdlld this in zabbix:

Preprocessing failed for: {}
1. Failed: cannot extract value from json by path "$["PhysicalDisks"]": no data matches the specified path

image

for lsi.pdlld.ctl

Preprocessing failed for: {"StorageControllers":[{"Id":0,"Model":"LSI MegaRAID 9361-8i","SerialNumber":"SV55347175","Firmwa...
1. Failed: cannot extract value from json by path "$["PhysicalDisks"]": no data matches the specified path

image

output of lsi.allinfo[storcli64]

zabbix_get -s 1.1.1.1 -k 'lsi.allinfo[storcli64]'
{"StorageControllers":[{"Id":0,"Model":"LSI MegaRAID 9361-8i","SerialNumber":"SV55347175","Firmware":"4.230.20-3532","State":"Optimal"}],"LogicalDisks":[{"ControllerId":0,"Consist":"Yes","Name":"raid_sata","Type":"RAID10","Size":"1.818 TB","State":"Optimal","DGVD":"0/0","LdId":"/c0/v0"},{"ControllerId":0,"Consist":"Yes","Name":"ssd_raid","Type":"RAID5","Size":"2.727 TB","State":"Optimal","DGVD":"1/1","LdId":"/c0/v1"}],"Batteries":[],"Flags":{"PdInfoFromCtl":false,"PdInfoArgs":"enclosure","BatteryExists":false,"BatteryInfoArgs":"stub"}}

output of lsi.pdsinfo[storcli64, enclosure]

{"PhysicalDisks":[{"Slot":"/c0/e252/s0","Model":"WD1004FBYZ-01YCBB1","Vendor":"WDC","Type":"HDD","Interface":"SATA","Size":"931.512 GB","SerialNumber":"WD-WMC6M0D827LS","State":"Online","MediaErrCount":0,"OtherErrCount":0,"PredictErrCount":0,"SmartFlag":"No","SlotnameSource":"LSI","Firmware":"RR04    "},{"Slot":"/c0/e252/s1","Model":"WD1004FBYZ-01YCBB1","Vendor":"WDC","Type":"HDD","Interface":"SATA","Size":"931.512 GB","SerialNumber":"WD-WMC6M0D71VK4","State":"Online","MediaErrCount":0,"OtherErrCount":0,"PredictErrCount":0,"SmartFlag":"No","SlotnameSource":"LSI","Firmware":"RR04    "},{"Slot":"/c0/e252/s2","Model":"WD1004FBYZ-01YCBB1","Vendor":"WDC","Type":"HDD","Interface":"SATA","Size":"931.512 GB","SerialNumber":"WD-WMC6M0D940ZL","State":"Online","MediaErrCount":0,"OtherErrCount":0,"PredictErrCount":0,"SmartFlag":"No","SlotnameSource":"LSI","Firmware":"RR04    "},{"Slot":"/c0/e252/s3","Model":"WD1004FBYZ-01YCBB1","Vendor":"WDC","Type":"HDD","Interface":"SATA","Size":"931.512 GB","SerialNumber":"WD-WMC6M0D0EMCT","State":"Online","MediaErrCount":0,"OtherErrCount":0,"PredictErrCount":0,"SmartFlag":"No","SlotnameSource":"LSI","Firmware":"RR04    "},{"Slot":"/c0/e252/s4","Model":"WDS100T2B0A-00SM50","Vendor":"WDC","Type":"SSD","Interface":"SATA","Size":"931.512 GB","SerialNumber":"2143A6444109","State":"Online","MediaErrCount":0,"OtherErrCount":0,"PredictErrCount":0,"SmartFlag":"No","SlotnameSource":"LSI","Firmware":"415020WD"},{"Slot":"/c0/e252/s5","Model":"WDS100T2B0A-00SM50","Vendor":"WDC","Type":"SSD","Interface":"SATA","Size":"931.512 GB","SerialNumber":"2143A6458101","State":"Online","MediaErrCount":0,"OtherErrCount":0,"PredictErrCount":0,"SmartFlag":"No","SlotnameSource":"LSI","Firmware":"415020WD"},{"Slot":"/c0/e252/s6","Model":"WDS100T2B0A-00SM50","Vendor":"WDC","Type":"SSD","Interface":"SATA","Size":"931.512 GB","SerialNumber":"2143A6445504","State":"Online","MediaErrCount":0,"OtherErrCount":0,"PredictErrCount":0,"SmartFlag":"No","SlotnameSource":"LSI","Firmware":"415020WD"},{"Slot":"/c0/e252/s7","Model":"WDS100T2B0A-00SM50","Vendor":"WDC","Type":"SSD","Interface":"SATA","Size":"931.512 GB","SerialNumber":"2143A6441609","State":"Online","MediaErrCount":0,"OtherErrCount":0,"PredictErrCount":0,"SmartFlag":"No","SlotnameSource":"LSI","Firmware":"415020WD"}],"SmartMap":{"2143A6441609":"/c0/e252/s7","2143A6444109":"/c0/e252/s4","2143A6445504":"/c0/e252/s6","2143A6458101":"/c0/e252/s5","WD-WMC6M0D0EMCT":"/c0/e252/s3","WD-WMC6M0D71VK4":"/c0/e252/s1","WD-WMC6M0D827LS":"/c0/e252/s0","WD-WMC6M0D940ZL":"/c0/e252/s2"}}

no error in test image

mykolq commented 1 month ago

It seems that all is OK. You firstly got method enclosure, set it to lsi.pdsinfo item and get info. What question do you have?

YogSottot commented 1 month ago

What question do you have?

The question is what is causing these errors in the panel:

Preprocessing failed for: {"StorageControllers":[{"Id":0,"Model":"LSI MegaRAID 9361-8i","SerialNumber":"SV55347175","Firmwa...
1. Failed: cannot extract value from json by path "$["PhysicalDisks"]": no data matches the specified path
mykolq commented 1 month ago

What question do you have?

The question is what is causing these errors in the panel:

Preprocessing failed for: {"StorageControllers":[{"Id":0,"Model":"LSI MegaRAID 9361-8i","SerialNumber":"SV55347175","Firmwa...
1. Failed: cannot extract value from json by path "$["PhysicalDisks"]": no data matches the specified path

It is OK too. This key got physical disks data when it is possible, if not - it is getting by other key

YogSottot commented 1 month ago

Please elaborate why it's not a error.

There are only two keys in the list to get information about Physical disks. The keys are lsi.pdlld and lsi.pdlld.ctl.

Both keys give an error. So all Item prototypes and Trigger prototypes related to Physical disks are not discovered.

mykolq commented 1 month ago

Please elaborate why it's not a error.

There are only two keys in the list to get information about Physical disks. The keys are lsi.pdlld and lsi.pdlld.ctl.

Both keys give an error. So all Item prototypes and Trigger prototypes related to Physical disks are not discovered.

First item got error while method is not set. In you first message output of lsi.pdsinfo[storcli64, enclosure is OK and you should not get an error

YogSottot commented 1 month ago

First item got error while method is not set

How should it be set? Is it related to the {$LSI_PD_METHOD} macro?

In the template the default value of this macro is stub. Is it correct value?

mykolq commented 1 month ago

First item got error while method is not set

How should it be set? Is it related to the {$LSI_PD_METHOD} macro?

In the template the default value of this macro is stub. Is it correct value?

Yes, this macro. Did you read the instruction?

YogSottot commented 1 month ago

After specifying {$LSI_PD_METHOD} enclosure for the host, the error for lsi.pdlld disappeared.

I did not apply the updatehostmacro.py script as I have only one host with such a controller. I didn't see the point and assumed that macros can be specified manually. The documentation clearly lacks information on the macros that need to be added.

Sorry for wasting your time.

mykolq commented 1 month ago

After specifying {$LSI_PD_METHOD} enclosure for the host, the error for lsi.pdlld disappeared.

I did not apply the updatehostmacro.py script as I have only one host with such a controller. I didn't see the point and assumed that macros can be specified manually. The documentation clearly lacks information on the macros that need to be added.

Sorry for wasting your time.

I forgot add about clearly set macro, it is good remark

YogSottot commented 1 month ago

Edited template. All macros necessary for work are included. Also renamed items. Example of new names on the screenshot.

May be useful to someone.

image

LSI_Perc_Lenovo agent 2 module.json