Disk full because of log file
-
Hi,
Rev 8231
ping.class.php writes Warning messages in log file all the time.
So file size is growing a lot.
Here are messages:Jun 23 13:36:20 crim-fog FOGPingHosts[1064]: PHP Warning: fsockopen(): unable to connect to 172.20.41.231:445 (Connection timed out) in /var/www/html/fog/lib/fog/ping.class.php on line 38
Jun 23 13:36:20 crim-fog FOGPingHosts[1064]: PHP Warning: fclose() expects parameter 1 to be resource, boolean given in /var/www/html/fog/lib/fog/ping.class.php on line 39I could stop this by modifiyng lines 38 and 39 in ping.class.php like that:
38 $fsocket = fsockopen($host,$port,$errno,$errstr,$timeout);
39 fclose($fsocket);replaced by:
38 $fsocket = @fsockopen($host,$port,$errno,$errstr,$timeout);
39 if ($fsocket) fclose($fsocket);But I don’t know if this is correct, since Tom removed at symbols in this commit:
https://github.com/FOGProject/fogproject/commit/c064e2b727869010192025102f9af3c0d8b768a3 -
you can also turn off the ping hosts feature altogether.
-
Thank you for this information.
But how can I do that ? I don’t find.And isn’t this ping host feature used to see green light in front of the host ?
-
But how can I do that ? I don’t find.
Web Interface -> FOG Configuration -> FOG Settings -> General Settings -> FOG_HOST_LOOKUP
And isn’t this ping host feature used to see green light in front of the host ?
Yes.
-
ok thank you
I should open my eyes
-
The @ in front of a function simply surpresses the warning. Tom disabled that to have more verbose output to work it to make it easier to resolve problems.
-
@Quazz I also did it because there were a lot of calls using the @ symbol. Using @ in front of functions is actually very taxing on the server too.
-
@Tom-Elliott said in Disk full because of log file:
@Quazz I also did it because there were a lot of calls using the @ symbol. Using @ in front of functions is actually very taxing on the server too.
Yes I first want to preserve my disk space
But pinging host is very usefull.So I don’t know how to solve these warnings, I’m not a php programmer.
It seems that timeout in fsockopen function doesn’t work for offline hosts -
I’ve added some minor code in hope to help thwart the spamming of the log with these fclose warnings. Typically, there should be plenty of space for the root partition (/) to write its log files. What is your FOG OS’s partition layout?
df -h
-
@Tom-Elliott
Images are on a separate partition.
/ partition is 12 Go, today I can see 5 Go free.
This is enough, but not when dozens of lines per second are written in log file.
And whit this one (ping), 2 warning messages are written for each host not on line.
It can grow rapidly. -
You could disable logging, though I’d highly recommend against it.
-
@Tom-Elliott
Maybe disable only warnings messages ?
So I mark this resolved
Thanks