Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zabbix 3.0 - Discovery rules problem #79

Open
Snowmanko opened this issue Feb 26, 2019 · 10 comments
Open

Zabbix 3.0 - Discovery rules problem #79

Snowmanko opened this issue Feb 26, 2019 · 10 comments

Comments

@Snowmanko
Copy link

Hi,

I am experiencing error Cannot create item: Incorrect function 'last' expression. Check expression part starting from "uHDD[". in Discovery rule - Template_HDD_SMARTMONTOOLS_2_WITH_LLD: smartctl-disks-discovery, can you advice what could cause this problem ?

I suppose there is some problem with .last expressions in Triggers.

Thanks for any advice.
BR!

@v-zhuravlev
Copy link
Owner

Hi!
Which version of template do you use?
What name of the disk that caused the error?

@v-zhuravlev
Copy link
Owner

Please reopen if still having this problem.

@Snowmanko
Copy link
Author

Snowmanko commented Apr 24, 2019

Sorry, I didn't see that you replied. I'm running Zabbix 3.0.25.
I can see only -> Cannot create item: Incorrect function 'last' expression. Check expression part starting from: "uHDD[".
.. in hosts "discovery rules" on name "Template_HDD_SMARTMONTOOLS_2_WITH_LLD: smartctl-disks-discovery".

How can I see full error, its probably cut because of the length by zabbix.

@v-zhuravlev v-zhuravlev reopened this Apr 24, 2019
@v-zhuravlev
Copy link
Owner

Check inside Tempalte -> Low level Discoveries -> Item prototypes. What is the expression of the item prototype with Type = calculated ?
Actually, can you export the template and post it here?

@Snowmanko
Copy link
Author

Snowmanko commented Apr 24, 2019

Only one with Type calculated in Item prototypes is : {#DISKNAME}: SMART critical errors total
Formula is :
last("uHDD["{#DISKCMD}",5 Reallocated]")+last("uHDD["{#DISKCMD}",Spin_Retry_Count]")+last("uHDD["{#DISKCMD}",Current_Pending_Sector]")+last("uHDD["{#DISKCMD}",Offline_Uncorrectable]")

Attaching exported XML, has to be zipped bcs of guthub.
zbx_export_templates.xml.zip

@Snowmanko
Copy link
Author

Error looks like this
Screen Shot 2019-04-24 at 17 56 36

@v-zhuravlev
Copy link
Owner

Do you have any items actually created?

@v-zhuravlev
Copy link
Owner

Can you run discovery script manually and show me the output?

@Snowmanko
Copy link
Author

Snowmanko commented May 2, 2019

Sure,

`
{
"data":[

	{
		"{#DISKMODEL}":"INTEL SSD",
		"{#DISKSN}":"XY",
		"{#DISKNAME}":"/dev/sda",
		"{#DISKCMD}":"/dev/sda -d sat",
		"{#SMART_ENABLED}":"1",
		"{#DISKTYPE}":"1"
	},
	{
		"{#DISKMODEL}":"INTEL SSD",
		"{#DISKSN}":"XY",
		"{#DISKNAME}":"/dev/sdb",
		"{#DISKCMD}":"/dev/sdb -d sat",
		"{#SMART_ENABLED}":"1",
		"{#DISKTYPE}":"1"
	},
	{
		"{#DISKMODEL}":"ST",
		"{#DISKSN}":"XY",
		"{#DISKNAME}":"/dev/sdc",
		"{#DISKCMD}":"/dev/sdc -d sat",
		"{#SMART_ENABLED}":"1",
		"{#DISKTYPE}":"0"
	},
	{
		"{#DISKMODEL}":"ST",
		"{#DISKSN}":"XY",
		"{#DISKNAME}":"/dev/sdd",
		"{#DISKCMD}":"/dev/sdd -d sat",
		"{#SMART_ENABLED}":"1",
		"{#DISKTYPE}":"0"
	},
	{
		"{#DISKMODEL}":"ST",
		"{#DISKSN}":"XY",
		"{#DISKNAME}":"/dev/sde",
		"{#DISKCMD}":"/dev/sde -d sat",
		"{#SMART_ENABLED}":"1",
		"{#DISKTYPE}":"0"
	},
	{
		"{#DISKMODEL}":"ST",
		"{#DISKSN}":"XY",
		"{#DISKNAME}":"/dev/sdf",
		"{#DISKCMD}":"/dev/sdf -d sat",
		"{#SMART_ENABLED}":"1",
		"{#DISKTYPE}":"0"
	},
	{
		"{#DISKMODEL}":"ST",
		"{#DISKSN}":"XY",
		"{#DISKNAME}":"/dev/sdg",
		"{#DISKCMD}":"/dev/sdg -d sat",
		"{#SMART_ENABLED}":"1",
		"{#DISKTYPE}":"0"
	},
	{
		"{#DISKMODEL}":"INTEL SSD",
		"{#DISKSN}":"XY",
		"{#DISKNAME}":"/dev/sdh",
		"{#DISKCMD}":"/dev/sdh -d sat",
		"{#SMART_ENABLED}":"1",
		"{#DISKTYPE}":"1"
	},
	{
		"{#DISKMODEL}":"INTEL SSD",
		"{#DISKSN}":"XY",
		"{#DISKNAME}":"/dev/sdi",
		"{#DISKCMD}":"/dev/sdi -d sat",
		"{#SMART_ENABLED}":"1",
		"{#DISKTYPE}":"1"
	}
]

}
`

I've reddacted manually DISKSN and DISKMODEL.

@Snowmanko
Copy link
Author

Do you have any items actually created?
Screen Shot 2019-05-02 at 12 18 33

Yes, this is from template. There are also correct items.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants