MIMIC PHP API Guide

  1. Table of Contents
  2. Requirements
  3. The MIMIC PHP API is an optional Update Wizard package, and requires the use of the PHP 5.5 or later. PHP is already installed on recent Linux platforms, but will have to be installed on the other platforms. MIMIC has been tested with PHP 5.6 on Linux.

  4. Class Reference
  5. The PHP API is modelled after the Java API. All classes and methods have the same name as in Java, except that PHP programming constructs are used. Click here for the generated Java reference documentation.

  6. Examples
    • The testapp.php program is an small test program to exercise the MIMIC PHP API just like in other language bindings. Invoke as follows (assuming MIMIC is running on the local host):

      % php testapp.php
      
      *****Starting PHP TestApp*****
      TestApp: test_get: 
      get_host: localhost
      get_port: 9797
      get_user: mimicuser
      get_number: 1
      get_privdir: /home/mimicuser/mimic/
      get_version: 16.00
      get_cfgfile: test-agent.cfg
      get_configured_list: 1 2 3 4 5 6 7
      get_active_list: 
      get_active_data_list: 
      get_changed_config_list: 1 2 3 4 5 6 7
      get_changed_state_list: {1 2} {2 2} {3 2} {4 2} {5 2} {6 2} {7 2}
      get_log: 
      get_interfaces: {p4p1} 
      get_cfg_file_changed: 1 
      get_sim_privdir: /home/uwe/mimic/
      get_protocols: snmpv1,snmpv2c,snmpv2,snmpv3,NETFLOW,TELNET
      get_product: 29
      get_netaddr: 192.9.200.14
      get_netdev: 
      ...
      

    • The phpinfo.php program is an small diagnostic program to print PHP information for your PHP environment. If any problems with PHP, run

      % php phpinfo.php
      

      and send us the output with your problem report.

    • The MIMICView-PHP GUI is a package downloadable with the Update Wizard and provides a web-based interface to MIMIC.