PHP code example of rwellens / nagios-cfg

1. Go to this page and download the library: Download rwellens/nagios-cfg library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

rwellens / nagios-cfg example snippets


$converter = new \NagiosCfg\Converter();
$file = 'tests/_data/cfg/test_nagios2.cfg';

$array = $converter->cfgFileToArray($file);

$cfgString = $converter->arrayToCfgString($array);