Ad Widget

Collapse

I realize getting script output as a file and ability for transfer binary output for

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Inakrin
    Junior Member
    • Dec 2009
    • 10

    #1

    I realize getting script output as a file and ability for transfer binary output for

    First. we need alter table (example for psql)
    ALTER TABLE scripts add isbase64 smallint default 0;
    ALTER TABLE scripts add isfile smallint default 0;
    ALTER TABLE scripts add ctype varchar(255) default 0;
    ALTER TABLE scripts add filename varchar(255) default 0;

    Then update affect files:
    include/scripts.inc.php
    include/locales/en_gb.inc.php
    /scripts.php
    /sysmaps.php
    /scripts_exec_file.php

    After this in Administration->scripts we will be able configure script for outputted it as file. And if output will be base64 encoding data, configure that will be decoded in php web interface. Also filename and content-type available.

    For example we can configure script as /usr/bin/ssh -i /home/zabbix/.ssh/id_rsa root@{HOST.CONN} "(ps aux; ps aux; ps aux; ps aux; ps aux; ps aux; ps aux; ps aux; ps aux; ps aux; ps aux; ps aux; ps aux; ps aux; ps aux; ps aux; ps aux; ps aux; ps aux; ps aux; )| bzip2 | base64" and as output get correct bzip file
    Attached Files
Working...