Ad Widget

Collapse

adding own scripts to zabbix

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mrmurdock
    Member
    • Aug 2009
    • 85

    #1

    adding own scripts to zabbix

    Hi,
    I am in need of some developement help to get zabbix to run our own created scripts. From the manual, there really does not seem to a flexible way to add a customized monitoring script to zabbix (zabbix 1.6.6).
    Can unsupported scripts (not created by SIA), be added as Template Items or not? If not, then How do I add the script to be monitored by zabbix interface (viewed through the zabbix gui/web interface)? Here is an attachement with screen shots of what I tried.
  • richlv
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Oct 2005
    • 3112

    #2
    can't see any attachment, but adding custom checks should be simple.
    see documentation - if you want the check to be executed by zabbix server directly, use external checks. if you want for it to be executed by the zabbix agent, use userparameters
    Zabbix 3.0 Network Monitoring book

    Comment

    • zabbix_zen
      Senior Member
      • Jul 2009
      • 426

      #3
      Mrmurdock, you didn't reply to richlv.

      But if you need to integrate more complex personalized metrics you can use perl/python/bash/whatever and then send them through zabbix_zender

      Comment

      • mrmurdock
        Member
        • Aug 2009
        • 85

        #4
        With external checks, does not the zabbix server expect that your script accepts the argument -h <ipaddress> of client (for example the built in ping and traceroute scripts).
        I tried this but, it would always return the value of zabbix server where the script was located. So the script or app...would have to rsh to the client to execute the command, if using external checks, or a more intelligent script is needed.
        So the userparameters is in each agent that has to be distributed to teh clients. Where then should I see the value returned inside of the zabbix interface?

        Comment

        • zabbix_zen
          Senior Member
          • Jul 2009
          • 426

          #5
          Wait,
          you want to use Zabbix agent UserParameter in conjunction with zabbix sender?

          Building a script to connect and gather just a few metrics from a remote host avoids having to deploy a full fledged agent there.

          Passing the script returned values to variables and assigning each one a key (which has to mirror the Zabbix Webinterface Item's key, don't forget to select Item Type: ZABBIX trapper)
          Will work flawlessly,
          just set the variables to fit your environment

          $ZABBIX_SENDER -z $ZABBIX_SERVER_IP -p $ZABBIX_SERVER_PORT
          -s $MONITORED_HOST -k $YOUR_CHOSEN_KEY -o $VALUE_TO_SEND

          PS: if sending a string replace $value_to_send by "$str"

          Comment

          Working...