Hi,
I'm having quiet a bit of headache to discover items from an external check.
I have machine where I would need monitor lot of items, and snmp can not be used, but an api.
I have created a script which takes 2 parameters, as the machine or IP, and the top level object I want discover.
The output looks like this:
(Valid JSON)
So my understanding was the discovery rule would really just make a counter out of this, and index top level items in this example 2 which would lead to create 2 items out of every item prototype I want.
I also understand that every item can have only 1 value attached to it.
So I was to create 3 item prototype here, as there is 3 meaningful value each disk have.
So having to try many things, but it still not clear for me what type the item prototype should be, as I never managed to get my items created by this way?
I would use something like this:
Item prototype:
name: Disk Ops {#DISKPERFDEVICENAME}
And then use the {#DISKPERFOPSPERSECOND} as value..
But what check type to use? What should be the key?
The script works from a simple item if I set it as external check and use key discovery-python["{HOSTNAME}",diskPerfEntry] so zabbix can use the script for sure and in a simple item, which set to text it records the full json output at each check.
I did try to turn on loglevel 5, but only thing I can see there is the periodic trigger of the discovery rule, but can not see any indication if it has any issue running it, or not even if it succeeded...
I have tried many combination, even to use a know working snmp discovery rule, which has the same number of items what I need, and then try to create dependent item prototypes pointing to a static value, but they never got created at the first place.
I have even tried with calculated items where only a static 5+5 formula in there, as I just wanted to see it would create the desired number of items with names like "test {#SNMPINDEX}" but again, no item being created.
I have added the script into an agent (running on the zabbix server), to try to do the discovery via agent check, and however the command works from terminal (zabbix_agent.d -t discovery-python-userparam["{HOSTNAME}",diskPerfEntry] ) but again, no items created from the prototypes.
Can someone tell me what am I'm missing in here, as the documentation, is detailed on SNMP discovery but almost zero information, on external checks and agent checks in the topic.
Thanks
I'm having quiet a bit of headache to discover items from an external check.
I have machine where I would need monitor lot of items, and snmp can not be used, but an api.
I have created a script which takes 2 parameters, as the machine or IP, and the top level object I want discover.
The output looks like this:
Code:
{
"data": [{
"{#DISKPERFBAY}": "1",
"{#DISKPERFDEVICENAME}": "Bay 1",
"{#DISKPERFOPSPERSECOND}": "552",
"{#DISKPERFINBITSPERSECOND}": "21307392",
"{#DISKPERFOUTBITSPERSECOND}": "451379"
},
{
"{#DISKPERFBAY}": "2",
"{#DISKPERFDEVICENAME}": "Bay 2",
"{#DISKPERFOPSPERSECOND}": "568",
"{#DISKPERFINBITSPERSECOND}": "18850611",
"{#DISKPERFOUTBITSPERSECOND}": "421888"
}
]
}
So my understanding was the discovery rule would really just make a counter out of this, and index top level items in this example 2 which would lead to create 2 items out of every item prototype I want.
I also understand that every item can have only 1 value attached to it.
So I was to create 3 item prototype here, as there is 3 meaningful value each disk have.
So having to try many things, but it still not clear for me what type the item prototype should be, as I never managed to get my items created by this way?
I would use something like this:
Item prototype:
name: Disk Ops {#DISKPERFDEVICENAME}
And then use the {#DISKPERFOPSPERSECOND} as value..
But what check type to use? What should be the key?
The script works from a simple item if I set it as external check and use key discovery-python["{HOSTNAME}",diskPerfEntry] so zabbix can use the script for sure and in a simple item, which set to text it records the full json output at each check.
I did try to turn on loglevel 5, but only thing I can see there is the periodic trigger of the discovery rule, but can not see any indication if it has any issue running it, or not even if it succeeded...
I have tried many combination, even to use a know working snmp discovery rule, which has the same number of items what I need, and then try to create dependent item prototypes pointing to a static value, but they never got created at the first place.
I have even tried with calculated items where only a static 5+5 formula in there, as I just wanted to see it would create the desired number of items with names like "test {#SNMPINDEX}" but again, no item being created.
I have added the script into an agent (running on the zabbix server), to try to do the discovery via agent check, and however the command works from terminal (zabbix_agent.d -t discovery-python-userparam["{HOSTNAME}",diskPerfEntry] ) but again, no items created from the prototypes.
Can someone tell me what am I'm missing in here, as the documentation, is detailed on SNMP discovery but almost zero information, on external checks and agent checks in the topic.
Thanks
Comment