2013. március 22., péntek

Nagios install (phew...okay I know...) on CentOS

We have to admit that all the IT folks should avoid using Nagios nowadays 'cause there are lots of nicer apps out there. Anyway, let's do this. I'm pretty sure you have read this but as a quick side note, you may want to consider also reading this. A working solution comes out of these two ones.
But wait. Compiling plugins on a brand new CentOS install drops an error:

check_http.c:312:9: error: ‘ssl_version’ undeclared (first use in this 

After half a minute long interaction with my friend Google, I found that I should do a simple apt-get install libssl-dev to exorcise the the problem. Okay but I have no such package on CentOS and don't want to go with the nuisance of making one from source. Openssl-devel package doesn't help either.
Huhh. What a mess. Solution: have a look at the pic. Fix that file in plugins/ according to this and ./configure && make all again.

2013. március 5., kedd

my little handy backup from php

  if ($_POST){
  exec ("find /var/www/ize -not -name \"backup_*\" -a -not -name \"backup.php\" -a -not -name \"*.zip\" -a -not -name \"error.log\" -a -not -path \"*/zend*\" -a -not -path \"*tmp/*\" -a -not -path \"*images/*\" -a -not -path \"*fotok*\" -type f -mtime -$nap > lista");
$fajl = "backup_".`date +%F_%H%M`.".tar.gz";
$output = `tar -cvzf /var/www/ize/backup_\`date +%F_%H%M\`.tar.gz --files-from lista`;
                  echo "DONE!";
                  echo "<a href=\"$fajl\">backup</a>";
                  echo "<pre>$output</pre>";
  } else {
  <form action="backup.php" method="post">
  file age limit to be backuped ?
  <input type="text" name="nap" id="nap" cols="2" rows="1">
  <button class="button" type="submit">GO</button>
<?php }; ?>