Ad Widget

Collapse

Perl JSON register new host

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • k0k
    Junior Member
    • Apr 2012
    • 9

    #1

    Perl JSON register new host

    Simple perl script to access the JSON API Zabbix, use the methods of access and register, designed to deploy via puppet and register each server without monkey assistence ;D, the requirements are perl-JSON-XS on Fedora/RHEL5+ or install via CPAN: cpan JSON::XS

    The Output :
    Connecting Sucessfull to http://192.168.xxx.xx/zabbix/api_jsonrpc.php
    Login Zabbix JSON API...
    id session: 6a7b4582b9e35c1bbc81f02544bd0db1
    Creating host on Zabbix...

    Download it in github repository: https://github.com/k0k/Zabbix/blob/m...gister-host.pl

    Review are welcome.
    Last edited by k0k; 30-04-2012, 17:23. Reason: minor change
  • beaudh
    Junior Member
    • May 2012
    • 1

    #2
    Hi k0k,

    This script works perfectly with 1.8.12 but with a fresh 2.0.0 install it doesn't seem to want to populate. I've had a look at the API changes for 2.0.0 but I'm not seeing anything off hand that has changed. I know that in 2.0.0 the API user group is removed and no longer needed. I've tried various permissions tweaks to the user but haven't had any success yet. Any idea what might need to be changed ?

    Thanks so much for the script!

    Comment

    • k0k
      Junior Member
      • Apr 2012
      • 9

      #3
      For the record: beaudh user made a slight adjustment for zabbix 2.0.0 support:


      For production environments with zabbix 1.8:

      Comment

      Working...