Here's what I'm trying to accomplish: I want to create a trigger that sends an alert when the mayor version of PHP on the server changes.
I currently have the version of PHP as a custom parameter with output such as:
[2012.Sep.06 16:36:44] PHP 5.3.6 (cli) (built: test env)
[2012.Sep.06 16:14:51] PHP 5.2.17 (cli) (built: Nov 15 2011 09:03:28)
[2012.Sep.06 15:59:51] PHP 5.2.17 (cli) (built: Nov 15 2011 09:03:28)
So the value is 'PHP 5.2.17 (cli) (built: Nov 15 2011 09:03:28)'.
I don't want to use a trigger based on .diff(), as that would also report it when a minor version (such as PHP 5.2.15 upgraded to 5.2.17) would change. I only want to trigger when PHP 5.2 would upgrade to 5.3.
I had the following in mind:
{Application - PHP
hp.version.regexp("^PHP 5.2",#1)}=1 & {Application - PHP
hp.version.regexp("^PHP 5.3")}=1
Basically: if the previous value of the php.version matches 'PHP 5.2' and the current value matches 'PHP 5.3', I know it was upgraded. However, this does not work, and I'm guessing it's because of the second parameter in .regexp() where I now use #3. I also tried simply entering 300 to express the time-shift in seconds, but to no avail.
We're running Zabbix 1.8, so according to the trigger wiki I don't think it's possible to do? Did anyone else accomplish something similar to compare text-values from previous & current values using regular expressions?
Or am I missing a more obvious and simple solution?
I currently have the version of PHP as a custom parameter with output such as:
[2012.Sep.06 16:36:44] PHP 5.3.6 (cli) (built: test env)
[2012.Sep.06 16:14:51] PHP 5.2.17 (cli) (built: Nov 15 2011 09:03:28)
[2012.Sep.06 15:59:51] PHP 5.2.17 (cli) (built: Nov 15 2011 09:03:28)
So the value is 'PHP 5.2.17 (cli) (built: Nov 15 2011 09:03:28)'.
I don't want to use a trigger based on .diff(), as that would also report it when a minor version (such as PHP 5.2.15 upgraded to 5.2.17) would change. I only want to trigger when PHP 5.2 would upgrade to 5.3.
I had the following in mind:
{Application - PHP
hp.version.regexp("^PHP 5.2",#1)}=1 & {Application - PHP
hp.version.regexp("^PHP 5.3")}=1Basically: if the previous value of the php.version matches 'PHP 5.2' and the current value matches 'PHP 5.3', I know it was upgraded. However, this does not work, and I'm guessing it's because of the second parameter in .regexp() where I now use #3. I also tried simply entering 300 to express the time-shift in seconds, but to no avail.
We're running Zabbix 1.8, so according to the trigger wiki I don't think it's possible to do? Did anyone else accomplish something similar to compare text-values from previous & current values using regular expressions?
Or am I missing a more obvious and simple solution?
Comment