Ad Widget

Collapse

How to implement Dynamic Host in Calculated Value for General Items/Discovered Items

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jayateertha.g
    Junior Member
    • Feb 2024
    • 3

    #1

    How to implement Dynamic Host in Calculated Value for General Items/Discovered Items

    I have 10 items(SNMP Agent - 10 OID's) configured in a template as shown below.
    Click image for larger version

Name:	image.png
Views:	195
Size:	65.4 KB
ID:	479340

    Now to get count of items which have non-null values in 1m, I have created another item/template with item having a calculated formula - count(/Host_1/service_down_issue1,1m)

    Click image for larger version

Name:	image.png
Views:	116
Size:	16.6 KB
ID:	479341​

    Notice that, calculated formula is count(/Host_1/service_down_issue1,1m) , where Host_1 is hardcoded hostname which is not dynamic.
    This makes templating very hard as for each new host we create, I have to add a new item utilizing same formula but for different host like count(/Host_2/service_down_issue1,1m), count(/Host_3/service_down_issue1,1m) etc.
    When host grows large in future it becomes difficult to manage 1000's of items duplicated just because we don't have dynamic host in calculated value.

    is it possible to use a dynamic host in the calculated value like count(/${HOST}/service_down_issue1,1m) ?
    Or do we have any other better method to implement this other than using API/SQL Queries ?

    Thanks and Regards
    Jayateertha G​
Working...