Ad Widget

Collapse

How add an external check to zabbix?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dga
    Junior Member
    • Aug 2007
    • 3

    #16
    Hi,

    SebD, I tried to activate an external check by taking exactly the script you mentionned at the beginning of this topic and doing what you did and it doesn't work, I always get "External check [check_apache.sh[]] is not supported" (I use "check_apache.sh[]" for the key and choose "text" for return type). I use the same version of Zabbix server as yours (1.4.1).

    By the way, I guess external checks are mostly used to monitor network available resources from Zabbix server. If you want to monitor things like apache procs, built-in or user-defined Zabbix agent type checks would be more appropriate.

    Comment

    • SebD
      Junior Member
      • Jul 2007
      • 24

      #17
      Hello dga!

      Ok thanks!
      That's what I've finally done : use Zabbix agent and configure zabbix_agentd.conf as you can see in my new post
      http://www.zabbix.org/forum/showthread.php?t=7238

      Sébastien

      Comment

      • dga
        Junior Member
        • Aug 2007
        • 3

        #18
        But do you have an idea why I can't use external checks? Must I modify any other parameter than ExternalScripts in zabbix_server.conf?

        Not relying on the agent for everything is very important to me so external checks must work if I am to use Zabbix in a production environment. As for simple checks , I think they are too basic and should be completely removed.

        I find it strange that it's what appears in the zabbix_server.log even though I selected "external check":

        Parameter [check_apache.sh[]] is not supported by agent on host [ZABBIX Server] Old status [0]

        Comment

        • dga
          Junior Member
          • Aug 2007
          • 3

          #19
          I solved my problem, thanks to spage in this topic:



          SebD, You have 1.4.1 and you said you put "[]" and it worked..? I installed 1.4.1 from the tar.gz available from the main site and I had to put "()" and modify defines.inc.php as said in the topic above.

          Comment

          • SebD
            Junior Member
            • Jul 2007
            • 24

            #20
            Originally posted by dga
            SebD, You have 1.4.1 and you said you put "[]" and it worked..? I installed 1.4.1 from the tar.gz available from the main site and I had to put "()" and modify defines.inc.php as said in the topic above.
            Hello dga!

            Yes, [] work only when it's on the same computer, not for distant server.

            Sébastien

            Comment

            • mcarbonneaux
              Member
              • Jul 2007
              • 31

              #21
              Originally posted by Alexei
              This is not quote true. ZABBIX 1.4.1 processes () just fine, the only problem is that () are not accepted by the front-end.
              ok! it's effectively the reverse... i've inverted my think with my saying...

              Comment

              • fableman
                Member
                • Oct 2007
                • 78

                #22
                using: zabbix-1.4-3

                I tried everything and I cant get external scripts thats on my zabbix server to work towards external host that dont have a zabbix agent running.

                What is wrong ?



                # Location of external scripts
                ExternalScripts=/etc/zabbix/externalscripts/
                ----------------------
                drwx---r-x 2 root zabbix 4096 Oct 24 11:40 externalscripts
                -rwxrwxrwx 1 root zabbix 59 Oct 24 11:40 icmp_host_ping.sh
                ----------------------
                Item:

                Type= External check

                Key = icmp_host_ping.sh[]

                --------------------------------
                Log file:

                Parameter [icmp_host_ping.sh[]] is not supported by agent on host [www.google.se] Old status [0]

                Comment

                • welkin
                  Senior Member
                  • Mar 2007
                  • 132

                  #23
                  same here
                  mfg
                  welkin

                  Comment

                  • fableman
                    Member
                    • Oct 2007
                    • 78

                    #24
                    BUMP.... this need to be resolved.!

                    Comment

                    • Tenzer
                      Senior Member
                      • Nov 2007
                      • 316

                      #25
                      It is working...

                      Hi

                      I've just added two external checks yesterday, and they worked as they should:
                      1. I've created the files in /etc/zabbix/externalscripts
                      2. Chmodded them with +x
                      3. Added them in Zabbix like "ntpcheck[]" ie.

                      It is working as it's supposed to. The script ntpcheck looks like this (I prefer to do things in PHP):
                      PHP Code:
                      #!/usr/bin/php
                      <?
                              // Check for required parameters
                              if($_SERVER["argv"][1])
                              {
                                      $ntp_server = $_SERVER["argv"][1];
                              } else {
                                      echo "You need to supply a NTP server to check. Quitting.\n";
                                      exit;
                              }

                              // Do query
                              $query = exec("ntpdate -q -t 0.1 ".$ntp_server, $output, $return);

                              if($return == 0)
                              {
                                      echo "1\n";
                              } else {
                                      echo "0\n";
                              }
                      ?>
                      It would help if you could show what scripts you are using, and how you have added it in zabbix.

                      Comment

                      • sebelk
                        Member
                        • Nov 2007
                        • 72

                        #26
                        Problem with parameters



                        I am using zabbix-1.4.2-2.fc6

                        I have a script alredy located in /etc/zabbix/externalscripts/ with 0755 as mode. It's a perl script that has this syntax:
                        script param1 param2

                        param1 and param2 are mandatory.


                        If you don't issue any parameters, script show right usage (as many commands in Linux)

                        (FYI script lists via snmp switch ports used by each vlan and *works properly* if I run out of zabbix)

                        Well, I went to Configuration of Items and added:
                        Description: upSnmpGet
                        Type: External Check
                        Key: upSnmpGet["10.1.0.4 vlanList"]

                        10.1.0.4 being parameter 1 and vlanList being parameter 2.

                        I saved and external check is added successfully but however I get:

                        usage: /etc/zabbix/externalscripts/upSnmpGet deviceAddress object

                        Please could you tell me if I Have something wrong in this config?

                        Thanks in advance!

                        Comment

                        • sebelk
                          Member
                          • Nov 2007
                          • 72

                          #27
                          hostname and more than one line

                          Hi,
                          I fixed partially the problem, I changed the switch name by his IP (an argument mandatory for the external script) and now it outputs "something", I mean, only one line, not the full output. I've tried with Character, Log and Text in type but it didn't worked.

                          Any ideas?

                          Thanks in advance!

                          Comment

                          • fableman
                            Member
                            • Oct 2007
                            • 78

                            #28
                            Originally posted by sebelk
                            Hi,
                            I fixed partially the problem, I changed the switch name by his IP (an argument mandatory for the external script)
                            please explain that a bit better ?

                            you changed the switch's name ? what switch ? you mean key ? trigger ?

                            Comment

                            • sebelk
                              Member
                              • Nov 2007
                              • 72

                              #29
                              Originally posted by fableman
                              please explain that a bit better ?

                              you changed the switch's name ? what switch ? you mean key ? trigger ?

                              I changed a Network switch name in Configuration of Hosts. I am not talking about of key nor trigger, I'm talk about of items as I stated in a earlier post.

                              Thanks in advance

                              Comment

                              Working...