Hey everyone,
I run Zabbix 2.0.2, yes I know it's kind of very old. No, I cannot upgrade it to the most recent one. I have to make do with what I have. Please, read on.
I have this weird issue, and I think the problem is obvious but I've been banging my head against this probably for too long to see it myself.
In essence, I have two custom checks defined via UserParameter. For one of the checks, when an associated trigger has been activated, e-mail notification's body arrives as an attachment. For the other, e-mail notification's body is what you would normally expect, i.e. just a text that makes a notification what we're all so used to seeing.
One of these checks gets CPU cores' temperature data, the other -- which is something I've configured quickly to create a similar check for troubleshooting purposes -- gets memory information.
So, here are the UserParameter definitions
and
And here's what happens when I run those commands manually in the terminal:
So, for cpu.temperature[*] item settings page looks like this:

associated trigger:

the trigger has no dependencies configured.
For test.free item I have almost identical configuration only Type of information is set to Numeric (unsigned), Data type Decimal. Likewise, associated trigger is a simple one that defines and expression of > N.
So, to my great surprise this produces an unexpected result. First, on the Latest Data page numbers show up as decimal numbers (why?!)

Then my e-mail notifications for this item/trigger pair look like this

However, text of notifications for test.free looks like normal e-mail body, not an attachment.
So, in UserParameter for cpu.temperature I tried to cut off the dot and anything that goes after it, to essentially create a decimal number, then adjusted cpu.temperature item's settings and set Type of information to Numeric (unsigned), Data type Decimal. Restarted Zabbix Agent, Latest data page would show data changing for both CPU cores, I could see graphs and all, but e-mail notifications would still arrive as attachments.
I cannot see how test.free is any different from cpu.temperature, and more importantly why Latest data page shows values as decimal numbers for cpu.temperature when they come in as floating point numbers (are they?), and items are configured to be floating point numbers too!
So, any ideas? Maybe you can see right off the bat what is wrong here?
I run Zabbix 2.0.2, yes I know it's kind of very old. No, I cannot upgrade it to the most recent one. I have to make do with what I have. Please, read on.
I have this weird issue, and I think the problem is obvious but I've been banging my head against this probably for too long to see it myself.
In essence, I have two custom checks defined via UserParameter. For one of the checks, when an associated trigger has been activated, e-mail notification's body arrives as an attachment. For the other, e-mail notification's body is what you would normally expect, i.e. just a text that makes a notification what we're all so used to seeing.
One of these checks gets CPU cores' temperature data, the other -- which is something I've configured quickly to create a similar check for troubleshooting purposes -- gets memory information.
So, here are the UserParameter definitions
Code:
UserParameter=cpu.temperature[*],/usr/bin/sensors |grep "$1" |cut -d " " -f9 | sed -e "s:^\+::g"
Code:
UserParameter=test.free,/usr/bin/free |grep Mem | awk -F " " {'print $2'}
% /usr/bin/sensors |grep "Core 0" |cut -d " " -f9 | sed -e "s:^\+::g"
48.0
% /usr/bin/free |grep Mem | awk -F " " {'print $2'}
3105864
48.0
% /usr/bin/free |grep Mem | awk -F " " {'print $2'}
3105864

associated trigger:

the trigger has no dependencies configured.
For test.free item I have almost identical configuration only Type of information is set to Numeric (unsigned), Data type Decimal. Likewise, associated trigger is a simple one that defines and expression of > N.
So, to my great surprise this produces an unexpected result. First, on the Latest Data page numbers show up as decimal numbers (why?!)

Then my e-mail notifications for this item/trigger pair look like this

However, text of notifications for test.free looks like normal e-mail body, not an attachment.
So, in UserParameter for cpu.temperature I tried to cut off the dot and anything that goes after it, to essentially create a decimal number, then adjusted cpu.temperature item's settings and set Type of information to Numeric (unsigned), Data type Decimal. Restarted Zabbix Agent, Latest data page would show data changing for both CPU cores, I could see graphs and all, but e-mail notifications would still arrive as attachments.
I cannot see how test.free is any different from cpu.temperature, and more importantly why Latest data page shows values as decimal numbers for cpu.temperature when they come in as floating point numbers (are they?), and items are configured to be floating point numbers too!
So, any ideas? Maybe you can see right off the bat what is wrong here?

Comment