Ad Widget

Collapse

Data collection in zabbix using http ($ _POST ??)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kamilalek1
    Junior Member
    • Jul 2016
    • 16

    #1

    Data collection in zabbix using http ($ _POST ??)

    I have a program that sends logs using the http protocol.
    On the web server I have created index.php

    <code>
    <?php

    # only do something if POST data contains 'message'
    if ($_POST['message'] != null ) {

    # set file name
    $filename = "post_".date('U').".txt";

    # open file for writing
    $file = fopen($filename, "w");

    # dump message to file
    fwrite($file, print_r($_POST['message'], true));

    # close file
    fclose($file);

    }
    </code>

    So in the program I have typed that the logs have to send to the address http://example.com/test5
    In the test5 directory I have the above-created index.php file created

    The logs on the web server register correctly.
    Is there a way to collect this data in Zabbix
Working...