Ad Widget

Collapse

manual data entry

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ppoetsma
    Junior Member
    • Mar 2009
    • 9

    #1

    manual data entry

    I have to monitor various parameters in the datacenter. Think about humidity, power, temperatures, etc. Some parameters are collected by SNMP enabled devices, others not. I would like to add manually collected data to Zabbix. So a couple of times per day I measure the external temperature and I want to add that to Zabbix to be able to correlate information.

    How should I do this?

    Regards,
    Paul
  • Calimero
    Senior Member
    • Nov 2006
    • 481

    #2
    Originally posted by ppoetsma
    I have to monitor various parameters in the datacenter. Think about humidity, power, temperatures, etc. Some parameters are collected by SNMP enabled devices, others not. I would like to add manually collected data to Zabbix. So a couple of times per day I measure the external temperature and I want to add that to Zabbix to be able to correlate information.
    On way of feeding data into zabbix is to use zabbix_sender, a CLI utility that ... sends (surprise!) data given on the command line to zabbix_server.

    First step would be to create a new item called "outside.temp" with type "Zabbix Trapper". Type numeric/float.
    Create item of the host that already has SNMP temp/moisture/power.

    Then from one host with zabbix_sender (you can do it from you zabbix server), run:

    /path/to/sbin/zabbix_sender -v -s test_manual -z my.zabbix.server.com -k outside.temp -o 19.2

    With:
    * 'test_manual' being the hostname as known by zabbix (be careful: case must match as zabbix is case-sensitive when handling data)
    * 'my.zabbix.server.com' is the hostname or IP of you zabbix server. If you're running zabbix_sender from your zabbix server you can try 127.0.0.1 (depending on how zabbix_server is configured)
    * -k specifies the item key name and -o the value

    Of course you can write a small shell script or just set a bash alias (in ~/.bashrc) to shorten it to: "outside.temp <value>"

    Code:
    $ alias
    ...
    alias outside.temp='/usr/local/zabbix/sbin/zabbix_sender -v -s test_manual  -z my.zabbix.server.com -k outside.temp -o '
    ...
    $ outside.temp 14.5
    Info from server: "Processed 1 Failed 0 Total 1 Seconds spent 0.016178"
    sent: 1; skipped: 0; total: 1
    Another option of course is to insert data directy into database but that sounds a bit like overkill for what you want to do.

    Comment

    • ppoetsma
      Junior Member
      • Mar 2009
      • 9

      #3
      Wow, as simple as that. I'm new to Zabbix and I had not found the commandline yet. Thanks, the example that you provided is very clear.

      Does Zabbix offer other interfaces, for example a PHP library to talk to Zabbix from a PHP script.

      Paul

      Comment

      • Calimero
        Senior Member
        • Nov 2006
        • 481

        #4
        An API is on the wishlist for 1.8. It may be a webservice.

        See this thread: http://zabbix.com/forum/showthread.php?t=10660

        Comment

        • ppoetsma
          Junior Member
          • Mar 2009
          • 9

          #5
          Thank you.

          Comment

          Working...