Ad Widget

Collapse

UserParameter for zabbix_server?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jack
    Junior Member
    • Apr 2005
    • 8

    #1

    UserParameter for zabbix_server?

    I need to use a 3rd party tool to monitor a special service. I can get by setting UserParameter in each agent, but that requires me to install this 3rd party tool on every server that is being monitored which is a big pain!

    Is it possible to have something like UserParameter that I can use for zabbix_server?
  • jack
    Junior Member
    • Apr 2005
    • 8

    #2
    Wouldn't this put all the collected data under the 1 server? I'm trying to have the data recorded under their respective machine.

    Comment

    • Alexei
      Founder, CEO
      Zabbix Certified Trainer
      Zabbix Certified SpecialistZabbix Certified Professional
      • Sep 2004
      • 5654

      #3
      ZABBIX v1.1 will possibly introduce 'external checks' , i.e. checks executed on ZABBIX server, kind of server-side UserParameters.
      Alexei Vladishev
      Creator of Zabbix, Product manager
      New York | Tokyo | Riga
      My Twitter

      Comment

      • jpawlowski
        Member
        • May 2005
        • 45

        #4
        this would be great!

        however I would also like to have the UserParameter in the agent to support variable parameters for the executed command.

        Comment

        • Alexei
          Founder, CEO
          Zabbix Certified Trainer
          Zabbix Certified SpecialistZabbix Certified Professional
          • Sep 2004
          • 5654

          #5
          Originally posted by jpawlowski
          however I would also like to have the UserParameter in the agent to support variable parameters for the executed command.
          It is already supported! Define your parameter as (for example):

          UserParameter=test[*], echo

          Then you may add items test[1], test[5], test[hello], etc. The '1', '5' and 'hello' will be passed to 'echo' as command line parameter.

          The following command will be executed:

          echo 1
          echo 5
          echo hello
          Alexei Vladishev
          Creator of Zabbix, Product manager
          New York | Tokyo | Riga
          My Twitter

          Comment

          • jpawlowski
            Member
            • May 2005
            • 45

            #6
            GREAT!!! thnx :-)

            so until the external checks are directly supported by the server, I just create userparameters for the agent on the zabbix-server itself.

            Comment

            • jpawlowski
              Member
              • May 2005
              • 45

              #7
              Btw: I had to modify the structure of mysql-table "items": field "key_" max length of 64 is not enough as I would like to be the parameter a URL. so i altered table with 'key_'=VARCHAR(128)

              Comment

              • fab
                Junior Member
                • Jun 2005
                • 22

                #8
                Originally posted by Alexei
                It is already supported! Define your parameter as (for example):

                UserParameter=test[*], echo

                Then you may add items test[1], test[5], test[hello], etc. The '1', '5' and 'hello' will be passed to 'echo' as command line parameter.

                The following command will be executed:

                echo 1
                echo 5
                echo hello
                Can I access the key parameter (e.g. 1, 5, hello) through a variable?

                Regards,
                Frank.

                Comment

                • fab
                  Junior Member
                  • Jun 2005
                  • 22

                  #9
                  Problem with UserParameter

                  Hi,

                  I want to Monitor the amount of used disk space in percent with zabbix and wrote a little perl script to do so. The script itself is working, but if I try to use it with zabbix by invoking the following key:

                  capacity[/]

                  and this User Parameter:
                  UserParameter=capacity[*],/usr/local/zabbix/bin/zsizeof.pl -f

                  I get in the shell on which the zabbix_agentd has been started the following error message:

                  sh: /: cannot execute

                  I use zabbix 1.0 on Solaris 10

                  Regards,
                  Frank.

                  Comment

                  • Wolfgang
                    Senior Member
                    Zabbix Certified Trainer
                    Zabbix Certified Specialist
                    • Apr 2005
                    • 116

                    #10
                    Did you check:

                    She-Bang Line?
                    Permissions?
                    eXecute Flag?
                    http://www.intellitrend.de
                    Specialised in monitoring large environments and Zabbix API programming.

                    Comment

                    • andresherrera
                      Junior Member
                      • Jan 2006
                      • 4

                      #11
                      Originally posted by Alexei
                      It is already supported! Define your parameter as (for example):

                      UserParameter=test[*], echo

                      Then you may add items test[1], test[5], test[hello], etc. The '1', '5' and 'hello' will be passed to 'echo' as command line parameter.

                      The following command will be executed:

                      echo 1
                      echo 5
                      echo hello

                      I, write a litle script to count the process runing for specific command and add the following line to the agentd config file:
                      UserParameter=WorkingProcess[*],/home/zabbix/scripts/working_process.sh


                      I probe the script with this:
                      [root@router zabbix]# /home/zabbix/scripts/working_process.sh mysqld
                      0



                      Next add the item:
                      WorkingProcess[mysqld]

                      But i receive this message on the onsole:
                      sh: line 1: mysqld: command not found

                      I have instaled zabbix 1.0

                      Can you help me?

                      Thanks
                      Andres Herrera

                      Comment

                      • jack
                        Junior Member
                        • Apr 2005
                        • 8

                        #12
                        It looks like your script is trying to invoke mysqld? You will probably need to specify its full path, or setup the path environment variable yourself.

                        Comment

                        • andresherrera
                          Junior Member
                          • Jan 2006
                          • 4

                          #13
                          Originally posted by jack
                          It looks like your script is trying to invoke mysqld? You will probably need to specify its full path, or setup the path environment variable yourself.
                          thanks Jack for your qickly responce, but the script only count the number of process runing and the parameter is only used for a regexp search, this is the code of the script:

                          #!/bin/bash

                          #Usage:
                          # working_process.sh daemonname
                          #

                          ps axr -o %c | grep ^$1\$ -c
                          And i probe the that script run under the user zabbix without problems.

                          I am running on Linux Redhat Enterprice 3.

                          Thanks!
                          Andres Herrera

                          Comment

                          • jack
                            Junior Member
                            • Apr 2005
                            • 8

                            #14
                            Did you try using full paths to ps and grep?

                            Comment

                            • andresherrera
                              Junior Member
                              • Jan 2006
                              • 4

                              #15
                              bug or a feature that is not supported

                              Originally posted by jack
                              Did you try using full paths to ps and grep?
                              Hi, and thanks again for your answer.

                              Today i have tried with many changes on the UserParameter with the same errors.

                              I try with the Alexi's example:
                              It is already supported! Define your parameter as (for example):

                              UserParameter=test[*], echo

                              Then you may add items test[1], test[5], test[hello], etc. The '1', '5' and 'hello' will be passed to 'echo' as command line parameter.

                              The following command will be executed:

                              echo 1
                              echo 5
                              echo hello
                              The result is the same, but now the error on the console are:

                              sh: line 1: 1: command not found
                              Then i tested this item:

                              test[echo 2]

                              The result was succesful, the system send back "2" as a result!

                              Then i think this is a bug or a feature that is not supported on my version of zabbix 1.0.

                              I read for many minutes the source code of the agent and found that my thoughs are correct:
                              UserParameter=myparam[*],/any/command
                              with the item: myparam[myrealcommand]
                              Result on execution of
                              "myrealcommand"
                              instead of
                              "/any/command myrealcommand"
                              For now, i'll create items with this "bug", but i think that must be changed on the new versions.

                              Thanks!
                              Andres Herrera

                              Comment

                              Working...