pavan kp
pavan kp

Reputation: 69

How to pass name of the host into tick script .exec() event handler

I am currently working in tick script, I want to pass host name as an argument when alert triggers from that specific host, so I am unable to find the exact variable to pass to that script.

            var trigger = data
                |alert()
                    .crit(lambda: "value" > crit)
                    .message(message)
                    .id(idVar)
                    .idTag(idTag)
                    .levelTag(levelTag)
                    .messageField(messageField)
                    .durationField(durationField)
                    .exec('/usr/bin/python', '/home/scripts/pythons/memory.py' ) // here need to pass host name

Upvotes: 0

Views: 764

Answers (1)

chrisckwong821
chrisckwong821

Reputation: 1173

in front of var trigger, you have var name for name of that scipt, just pass string(name) inside .exec as the second argument

Upvotes: 0

Related Questions