Announcement

Collapse
No announcement yet.

[function.unlink]

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [function.unlink]

    Salut à tous,

    Voici mon petit problème;

    Lorsque je supprime un host, il y a ça qui s'affiche :
    Code:
    Warning: unlink(/usr/local/oreon/rrd/62_21.rrd) [function.unlink]: Permission denied in /usr/local/oreon/www/include/configuration/configObject/host/DB-Func.php on line 80
    
    Warning: unlink(/usr/local/oreon/rrd/62_22.rrd) [function.unlink]: Permission denied in /usr/local/oreon/www/include/configuration/configObject/host/DB-Func.php on line 80
    
    Warning: unlink(/usr/local/oreon/rrd/62_23.rrd) [function.unlink]: Permission denied in /usr/local/oreon/www/include/configuration/configObject/host/DB-Func.php on line 80
    
    Warning: unlink(/usr/local/oreon/rrd/62_29.rrd) [function.unlink]: Permission denied in /usr/local/oreon/www/include/configuration/configObject/host/DB-Func.php on line 80
    
    Warning: unlink(/usr/local/oreon/rrd/62_32.rrd) [function.unlink]: Permission denied in /usr/local/oreon/www/include/configuration/configObject/host/DB-Func.php on line 80
    
    Warning: unlink(/usr/local/oreon/rrd/62_34.rrd) [function.unlink]: Permission denied in /usr/local/oreon/www/include/configuration/configObject/host/DB-Func.php on line 80
    
    Warning: unlink(/usr/local/oreon/rrd/62_71.rrd) [function.unlink]: Permission denied in /usr/local/oreon/www/include/configuration/configObject/host/DB-Func.php on line 80
    
    Warning: unlink(/usr/local/oreon/rrd/62_73.rrd) [function.unlink]: Permission denied in /usr/local/oreon/www/include/configuration/configObject/host/DB-Func.php on line 80
    L'host se supprime quand même, mais c'est pas beau.

    voici la fonction en cause dans DB-Func.php:
    Code:
    		global $pearDB;
    		global $oreon;
    		foreach($hosts as $key=>$value)	{
    			$rq = "SELECT @nbr := (SELECT COUNT( * ) FROM host_service_relation WHERE service_service_id = hsr.service_service_id GROUP BY service_service_id ) AS nbr, hsr.service_service_id FROM host_service_relation hsr, host WHERE hsr.host_host_id = '".$key."' AND host.host_id = hsr.host_host_id AND host.host_register = '1'";
    			$res = & $pearDB->query($rq);
    			if (PEAR::isError($pearDB)) {
    				print "Mysql Error : ".$pearDB->getMessage();
    			}
    			while ($res->fetchInto($row))
    				if ($row["nbr"] == 1)
    					$pearDB->query("DELETE FROM service WHERE service_id = '".$row["service_service_id"]."'");
    			$pearDB->query("DELETE FROM host WHERE host_id = '".$key."'");
    			if (PEAR::isError($pearDB)) {
    				print "Mysql Error : ".$pearDB->getMessage();
    			}
    			$files = glob($oreon->optGen["oreon_rrdbase_path"].$key."_*.rrd");
    			foreach ($files as $filename)
    				unlink ($filename);   // LIGNE 80 /!\/!\/!\/!\/!\/!\/!\
    		}
    	}
    les .rdd sont en nagios:nagcmd et 777 .

    Où est l'erreur ?
    Debian 3.1 Nagios 2.4 & Oreon 1.3

  • #2
    Le groupe apache n'est pas dans nagcmd ?
    (En fait quand on supprime un host, on supprime ses services, et par extension les bases rrd reliees aux services).
    Romain Le Merlus
    Centreon Forge
    MERETHIS

    Comment


    • #3
      Oui www-data est dans nagcmd aussi.
      Debian 3.1 Nagios 2.4 & Oreon 1.3

      Comment

      Working...
      X