Ad Widget

Collapse

ZBX_NOTSUPPORTED UserParameter

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bruno.galindro
    Junior Member
    • Oct 2013
    • 9

    #1

    ZBX_NOTSUPPORTED UserParameter

    Guys,

    We've implemented an apache monitoring template based on this article: https://www.zabbix.com/wiki/doku.php...mplates/apache. We adopted Method 3 to do that monitoring. All of our agents were zabbix version 1.8.

    After upgrading all of then to 2.0.8, UserParameter not worked anymore. It shows ZBX_NOTSUPPORTED after exec zabbix_get.

    In client, we see this message:
    1459:20131002:080209.710 Requested [apache[BusyWorkers]]
    1459:20131002:080209.710 Sending back [ZBX_NOTSUPPORTED]

    But zabbix agent don't execute the script (I've put an echo in the script's first line to trace the execution). It simply send ZBX_NOTSUPPORTED. I thing there is a bug with UserParameter or the sintax was changed in version 2.0.8, because other templates that uses UserParameter isn't working anymore.


    /etc/zabbix/zabbix_agentd.conf:
    Code:
    PidFile=/var/run/zabbix/zabbix_agentd.pid
    LogFile=/var/log/zabbix-agent/zabbix_agentd.log
    LogFileSize=0
    DebugLevel=4
    EnableRemoteCommands=1
    Server=xxxxxxxxxxxx
    Hostname=150162002111
    AllowRoot=1
    Include=/etc/zabbix/zabbix_agentd.conf.d/
    UnsafeUserParameters=1
    UserParameter=apache[*],/etc/zabbix/apache.sh '$1'

    ERROR:
    Code:
    root@zabbix:~# zabbix_get -s xxxxxxx -k 'apache[BusyWorkers]'
    ZBX_NOTSUPPORTED
  • bruno.galindro
    Junior Member
    • Oct 2013
    • 9

    #2
    Guys, any return?

    Comment

    • bruno.galindro
      Junior Member
      • Oct 2013
      • 9

      #3
      Any return???

      Comment

      • Pada
        Senior Member
        • Apr 2012
        • 236

        #4
        I don't know zabbix_get command at all, so I cannot help you there.

        What you can do is to check your permissions, by running the apache script as root and then under the Zabbix user:
        Code:
        /etc/zabbix/apache.sh BusyWorkers
        su zabbix -c '/etc/zabbix/apache.sh BusyWorkers'
        If both works, then remove the single quotes from your UserParameter line and restart the Zabbix agent daemon. Also make sure that your apache.sh script doesn't output unnecessary newlines.
        If only the first script (that ran as root) worked, then your zabbix user does not have permissions to execute that script (or parts of it).
        If none of them worked, then your script doesn't have execute permissions or it is flawed.

        Comment

        • bruno.galindro
          Junior Member
          • Oct 2013
          • 9

          #5
          Pada,

          Thank you for your help, but none of the procedures helped me.

          1 - Zabbix agent is running with root privileges (AllowRoot = 1), so, isn't necessary that zabbix user could execute that script. Sorry if I don't tell it before.

          Code:
          root@pg1:~# ps aux |grep zabb
          root      9472  0.0  0.0  79828  1160 ?        S    12:30   0:00 /usr/sbin/zabbix_agentd
          root      9475  0.0  0.0  79828  1284 ?        S    12:30   0:00 /usr/sbin/zabbix_agentd
          root      9476  0.0  0.0  84008  1956 ?        S    12:30   0:00 /usr/sbin/zabbix_agentd
          root      9477  0.0  0.0  84008  1952 ?        S    12:30   0:00 /usr/sbin/zabbix_agentd
          root      9478  0.0  0.0  84008  1948 ?        S    12:30   0:00 /usr/sbin/zabbix_agentd
          root      9566  0.0  0.0   9388   912 pts/0    S+   12:41   0:00 grep --color=auto zabb
          2 - I've removed the single quotes and restarted the agent as you sugested but not worked. I've even added a backslash at beginning of parameter (\$1), but not worked too.

          The fact is: zabbix is not executing the script, as I explained before. So, I think this is a bug of version 2.0.8, because everything was working before zabbix agent upgrade.

          Comment

          • bruno.galindro
            Junior Member
            • Oct 2013
            • 9

            #6
            Bug confirmation

            #### FIRST:
            Zabbix package mainteners, I don't know why!!!!!, changed various paths inside zabbix agent configuration and init script in version 2.0. Here they are:
            Code:
            ---- /etc/zabbix/zabbix_agentd.conf ----
            
            Version 1.8.x:
            LogFile=/var/log/zabbix-agent/zabbix_agentd.log
            PidFile=/var/run/zabbix-agent/zabbix_agentd.pid
            Include=/etc/zabbix/zabbix_agentd.conf.d/
            
            Version 2.0.x:
            LogFile=/var/log/zabbix/zabbix_agentd.log
            PidFile=/var/run/zabbix/zabbix_agentd.pid
            Include=/etc/zabbix/zabbix_agentd.d/
            
            ---- /etc/init.d/zabbix-agent ----
            Version 1.8.x:
            DIR=/var/run/zabbix-agent
            
            Version 2.0.x:
            DIR=/var/run/zabbix

            #### SECOND:
            After run zabbix_agentd -p in zabbix agent machine, I've noticed this error:
            zabbix_agentd [10010]: /etc/zabbix/zabbix_agentd.conf.d/: [2] No such file or directory

            This directory was renamed to /etc/zabbix/zabbix_agentd.d after upgrade. As I've choised to mantain the old configuration file (for compatibility purposes), that path was maintened wrong in my config file.


            #### THIRD:
            Inside that dir is placed only one file called userparameter_mysql.conf which is used to monitor mysql status. This file installed by default.


            #### FOURTH:
            The directive Include=/etc/zabbix/zabbix_agentd.d/ is placed BEFORE the directive UserParameter=apache[*],/etc/zabbix/apache.sh $1, as you can see bellow:

            Code:
            root@pg1:~# egrep -v '^$|^#' /etc/zabbix/zabbix_agentd.conf
            PidFile=/var/run/zabbix/zabbix_agentd.pid
            LogFile=/var/log/zabbix-agent/zabbix_agentd.log
            LogFileSize=0
            EnableRemoteCommands=1
            Server=xxxxxxxxxxx
            Hostname=11111111111
            AllowRoot=1
            [B][I]Include=/etc/zabbix/zabbix_agentd.d/[/I][/B]
            [I][B]UserParameter=apache[*],/etc/zabbix/apache.sh '$1'[/B][/I]

            #### FIFTH:
            It seems that zabbix agent doesn't considered UserParameter configuration directive as Include directive has a wrong value, ignoring it at startup.
            To validate the scenario, I've placed AllowRoot=1 directive bellow the Include directive with a wrong value. After that, zabbix agent was started with zabbix user, not with root user as expected.

            So, the conclusion is: zabbix agent version 2.0.8 has a BUG in parsing parameters from config file.
            Last edited by bruno.galindro; 08-10-2013, 18:59.

            Comment

            • bruno.galindro
              Junior Member
              • Oct 2013
              • 9

              #7
              BUG ticket link

              Comment

              • mbsit
                Senior Member
                • Sep 2012
                • 130

                #8
                Lets do the debug!

                Stop the agentd
                1: Remove all lines from the config file except: Server=. Add the "localhost" at the end.
                2: Set DebugLevel to 4
                3: Carefully check if you run zabbix agent 2.0.8 not 1.8. Because of config and file location changed, check if scripts are corect etc..
                4. Check the log files.

                Run agentd.
                You can run agentd from init scripts or from command line.
                .. and send as a log output

                Bests,
                Grzegorz

                --
                Wdrożenia Zabbix - Warszawa
                Pozdrawiam
                Grzegorz Grabowski
                ____
                WdroĊĵenia, szkolenia, umowy serwisowe
                Warszawa - Polska

                Comment

                Working...