Tag: Nagios
Linux
Read More
Script to parse file content from one file to another
This is a PHP script that parse file content from a file and writes this to another config file. #!/usr/bin/php -q < ?php if ($_SERVER[‘argv’][1] == ”) { die(“Usage: ./nagiosparse filename. Sourcefile must be a list with ,\n”); } $strFile = $_SERVER[‘argv’][1]; $arrContents = explode(“\n”, file_get_contents($strFile)); foreach ($arrContents as $strLine) { if(!empty($strLine)) { $arrCells = […]
Linux
Read More
Nagios config sjekk
For å sjekke at nagios ikke har feil i config filene kan man kjøre kommandoen: ./nagios -v ../etc/nagios.cfg