Hi All,
I have this interesting problem to solve - everytime item value changes it should be saved in external database!
My configuration:
Zabbix server - CENTOS
Zabbix agent (active) - Mac OSX
Item: MacOSXUpTime
Key system.uptime
Trigger
MacUpTimeChange - {PatrykMac:system.uptime.now(0)}>1
Action
MacUpTimeProblem
Maintenance status not in "maintenance" AND Trigger value = "PROBLEM" AND Trigger name like "MacUpTimeChange"
Run remote commands on current host - Global Script - Add_to_database
Script
Add_to_database
mysql -utest -ptest -htest.myexternal.server -Dtest -e "Insert into ptr_test (nazwa) VALUES('{TRIGGER.NAME}');"
Now, all this workes. Whenever trigger goes up script is adding new line to database called {TRIGGER.NAME}
My problems
Whats added to database is {TRIGGER.NAME}, how do I add "MacUpTimeChange"
And is its possible can I add last item value to that as well?
Many thanks for help
Patryk
I have this interesting problem to solve - everytime item value changes it should be saved in external database!

My configuration:
Zabbix server - CENTOS
Zabbix agent (active) - Mac OSX
Item: MacOSXUpTime
Key system.uptime
Trigger
MacUpTimeChange - {PatrykMac:system.uptime.now(0)}>1
Action
MacUpTimeProblem
Maintenance status not in "maintenance" AND Trigger value = "PROBLEM" AND Trigger name like "MacUpTimeChange"
Run remote commands on current host - Global Script - Add_to_database
Script
Add_to_database
mysql -utest -ptest -htest.myexternal.server -Dtest -e "Insert into ptr_test (nazwa) VALUES('{TRIGGER.NAME}');"
Now, all this workes. Whenever trigger goes up script is adding new line to database called {TRIGGER.NAME}
My problems
Whats added to database is {TRIGGER.NAME}, how do I add "MacUpTimeChange"
And is its possible can I add last item value to that as well?
Many thanks for help
Patryk
Comment