Ad Widget

Collapse

help me with php script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rodrigotl
    Junior Member
    • Feb 2007
    • 8

    #1

    help me with php script

    I want to use a php script in UserParameter like:


    UserParameter=db.size,php /root/calc_zdb_size.php


    This php script has in the end the following line:

    echo $size;

    ,where size is the number of bytes in my zabbix database.

    But when I configure the item db.size on zabbix server web interface it does not works. It shows me "Not Supported". Then I go to the zabbix_server.log and see that:

    027856:20070518:112453 Parameter [db.size] is not supported by agent on host [Aquarius2] Old status [0]
    027856:20070518:112511 Type of received value [1417019392 ] is not sutable for [db.size@Aquarius2] having type [3]

    It seems that zabbix is not recognizing an integer value but a string. What can I do to make zabbix get a number (integer or float value)?

    I wait for your help!

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

    #2
    It seems that the extra space in '1417019392 ' makes the difference.
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    • rodrigotl
      Junior Member
      • Feb 2007
      • 8

      #3
      OK, but the problem is with the echo function? Or with php? What could I do to solve that?

      Comment

      • rodrigotl
        Junior Member
        • Feb 2007
        • 8

        #4
        I´ve solved my problem using an ambient variable in linux:

        UserParameter=db.size,export dbsize=`php /root/calc_zdb_size.php`|bc; echo $dbsize

        Bye!

        Comment

        Working...