Ad Widget

Collapse

Creating images via ZabbixAPI

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mserg
    Junior Member
    • Feb 2011
    • 8

    #1

    Creating images via ZabbixAPI

    PHP Code:
    require_once("ZabbixAPI.class.php");

    $img_filename='/usr/local/share/zabbix/map-images/cell.png';

    $img_file=fopen($img_filename'rb');

    $img_data=fread($img_filefilesize($img_filename));

    $img_create ZabbixAPI::query('image','create',array('name'=>'myImage''image'=>base64_encode($img_data),'imagetype'=>2));

    fclose($img_file); 


    write base64-coded blob field into table "image" mysql-db Zabbix (1.8.3), but after adding image via zabbix-frontend in blob-field by written decoded binary.



    Zabbix-frontend not read data from encoded blob.

    It's compatibility issue?

    How can I write unencoded binary via ZabbixAPI::query()?
    Last edited by mserg; 18-02-2011, 12:29.
  • mserg
    Junior Member
    • Feb 2011
    • 8

    #2
    fixed

    ${zabbix-www}/api/classes/class.cimage.php (323):
    add decoding before writing to the database:
    PHP Code:
    image['image'] = base64_decode($image['image']); 
    Last edited by mserg; 18-02-2011, 12:29.

    Comment

    • mserg
      Junior Member
      • Feb 2011
      • 8

      #3
      fixed in 1.8.4 =\

      Comment

      • ribbon
        Junior Member
        • Feb 2011
        • 4

        #4
        The most problems that occur with the zabbix is with the server 1.8.3. And most of the problems are related with it. I think that your problem was gone as a result of the upgrade. Anyway I would recommend to update it so that most problems that will be solved as a result of it.

        Comment

        Working...