1

I have installed zabbix and running an external script - here is the steps I followed :

  1. created a /etc/zabbix/externalscripts directory with correct rights
  2. copied the script to this directory,
  3. On web interface Administration -> Scripts -> new script
    In the commands section - > /usr/lib/zabbix/externalscripts/check.py https://mywebsite.com
  4. Also create an item with type External Check and key is the file name of the script check.py and type of information is Numeric
  5. Create a graph - > added the item I created above to plot - but the status already says Not Supported. If I change the type to character it never shows up in the items.

So now I get an error in the logs

ÏndexError:list index out of range]is not suitable for value type [numeric unsigned] and data type [decimal]

What I have checked:

I ran the script from the command prompt and it executes with the result:

OK, Total Resp Time: 8334.55ms;|8321.55 

I am not sure what else I need to check. Have changed the type to Float etc without any help.
The permissions to the directory is fine.
Any help would be appreciated.
zabbix version 3.2 running on centos 7

1 Answer 1

1

First, there was no need to add Administration -> Scripts for external checks.

Second, if your script returns "OK, Total Resp Time: 8334.55ms;|8321.55", that is not a number and cannot be put in a numeric item and you will not be able to see a graph of such a string, of course.

Third, the error when running it manually looks like yet another problem. Make sure two things are covered when you run it manually:

  • run it as the Zabbix user
  • make sure there are no environment variables that affect the script behaviour; if there are, handle that in the script itself
2
  • Thanks - I now changed so the output is just a number like 8334.22 and changed the item to float. It still does not work. So now its like this : check.py["{HOST.CONN}"] is the key whereas the script runs well from the command line if I type check.py mywebsite.com and returns a number. The error that I get now is "No schema supplied. is not suitable for value type [Numeric (unsigned)] and data type [Decimal]". I have run it as a zabbix user and it does work well Commented Oct 26, 2016 at 8:14
  • Did you check for environment variables having effect on the script operation? Where does the No schema supplied error come from? Commented Oct 26, 2016 at 12:39

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.