Ad Widget

Collapse

Python script in /externalscripts not found

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • arrayown
    Junior Member
    • Jan 2017
    • 6

    #1

    Python script in /externalscripts not found

    Hello all,

    First time posting. Been using Zabbix for over a year. Thank you for such a great piece of software!

    I am trying to setup Zabbix to collect information from certain Wowza servers. I am using this code from this Github repo:


    I am running Zabbix 3.0.7 on Ubuntu 14.04. I installed Zabbix via Zabbix Repo PPA.

    I set everything up correctly but I'm still getting the following error in /var/log/zabbiz/zabbix_server.log and item becomes "Not Supported" thereafter:

    Code:
    ... item "WOWZA-SERVER:getWowzaInfo.py["-u","{$WOWUSER}","-p","{$WOWPASS}","-h","{HOST.CONN}","-P","8086","-a","appnum"]" became not supported: Received value [sh: 1: /usr/lib/zabbix/externalscripts/getWowzaInfo.py: not found] is not suitable for value type [Numeric (unsigned)] and data type [Decimal]
    ... item "WOWZA-SERVER:getWowzaInfo.py["-u","{$WOWUSER}","-p","{$WOWPASS}","-h","{HOST.CONN}","-P","8086","-a","conn"]" became not supported: Received value [sh: 1: /usr/lib/zabbix/externalscripts/getWowzaInfo.py: not found] is not suitable for value type [Numeric (unsigned)] and data type [Decimal]

    This is what I checked to make sure that the file is there and is able to run:

    1) Check ownership/permissions:
    Code:
    /usr/lib/zabbix/externalscripts# ls -l
    total 4
    -rwxr-xr-x 1 zabbix zabbix 1719 Jan  3 00:17 getWowzaInfo.py
    (Same ownership on root dir as well)

    2) Verify that Zabbix runs as user "zabbix"
    Code:
    zabbix   26958  0.0  0.2 246364 10856 ?        S    00:43   0:00 /usr/sbin/zabbix_server
    3) Confirm that script runs fine from SSH with 'zabbix' user:

    Code:
    sudo -H -u zabbix bash -c 'python /usr/lib/zabbix/externalscripts/getWowzaInfo.py -u wowzaUsername -p wowzaPassword -h xxx.xxx.xxx.xxx -a conn' 
    168
    4) Verify that /etc/zabbix/zabbix_server.conf has correct externalScripts path:
    Code:
    ExternalScripts=/usr/lib/zabbix/externalscripts
    The only thing I have not tried is wrapping the Python script in a Bash script but it didn't say in the manual if that is necessary.

    Can someone please help me figure this out?

    Thank you for your time.
  • SBO
    Zabbix Certified Specialist
    Zabbix Certified Specialist
    • Sep 2015
    • 226

    #2
    EDIT : Wrong post, will check this out a bit later
    Last edited by SBO; 03-01-2017, 12:31.

    Comment

    • arrayown
      Junior Member
      • Jan 2017
      • 6

      #3
      SOLVED: Shebang line

      I solved the problem.

      The issue was the shebang line on top of the .py script. The Github page had this shebang:

      Code:
      #!/bin/env python
      and I changed it to:

      Code:
      #!/usr/bin/env python
      I guess it's because I run Ubuntu server and not CentOS so the path is different.

      I hope this helps someone and I'm really happy that I can now track my Wowza connections in Zabbix. Thanks again, everyone, for making such a great software!

      Comment

      • ZabbixMan
        Junior Member
        • Jul 2017
        • 4

        #4
        I am using the same script as you lol. How did you create a trigger for email alerts using that script?

        Comment

        Working...