I've created a custom item with the key "service.ssh.port" that contains the port number that the SSH service is listening on for the given host. I would like to create another item that utilizes the "net.tcp.service[ssh]" simple check to make sure the service is running. My understanding is that I can set the key to "net.tcp.service[ssh,,<port>]", where "<port>" is the port number to check. How could I take the value from the "service.ssh.port" item and pass it into that third parameter of the "net.tcp.service[ssh]" check?
Ad Widget
Collapse
Use the value of an item as part of the key for another item
Collapse
This topic has been answered.
X
X
-
Tags: None
-
Answer selected by inventor96 at 19-01-2022, 09:10.
-
It's not changing, but we do have a handful of different ports used across our servers. It would be nice to automate it across all of our servers instead of having to configure each one.Comment
-
Use LLD to generate an item with the necessary parameters
The logic is as follows: received the port number from the device, made json from it with {#SSHPORT} macro and fed it to LLD, who based on it made an item with the key "net.tcp.service[ssh,,{#SSHPORT}]"- Selected Answer
Comment
-
Hello everyone,
I've been trying something similar in my Zabbix configuration, but I still could need some help. I'm using the docker monitoring template and want to use the item prototype "Container {#NAME}: Image", which will query the current image name of the individual container and use this information as a parameter in another custom item prototype having the key "script.php["{#IMAGE_VERSION}", "{#NAME}"]. The {#IMAGE_VERSION} macro should have the value of the before mentioned item prototype, in order that I can use the image name of the individually discovered containers for further processing in my PHP script.
Hamardaban, your approach using LLD seems quite interesting, thank you for that. I tried to adapt your solution to my scenario, but to no avail. I've never done anything with LLD before, so it would be nice if you could guide me a little bit on how to configure the LLD approach according to my use case
Thank you in advance for any useful tips regarding this topic.
Kind Regards,
Locrian​Comment
Comment