1, // 'KB' => 1024, // 'MB' => 1024 * 1024, // 'GB' => 1024 * 1024 * 1024, // 'TB' => 1024 * 1024 * 1024 * 1024, // 'PB' => 1024 * 1024 * 1024 * 1024 * 1024, /* chk if snort log dir is full if so clear it */ $snortloglimit = $config['installedpackages']['snortglobal']['snortloglimit']; $snortloglimitsize = $config['installedpackages']['snortglobal']['snortloglimitsize']; if ($g['booting']==true) return; if ($snortloglimit == 'off') return; $snortloglimitDSKsize = exec('/bin/df -k /var | grep -v "Filesystem" | awk \'{print $4}\''); $snortlogAlertsizeKB = snort_Getdirsize('/var/log/snort/alert'); $snortloglimitAlertsizeKB = round($snortlogAlertsizeKB * .70); $snortloglimitsizeKB = round($snortloglimitsize * 1024); /* do I need HUP kill ? */ if (snort_Getdirsize('/var/log/snort/') >= $snortloglimitsizeKB ) { conf_mount_rw(); if(file_exists('/var/log/snort/alert')) { if ($snortlogAlertsizeKB >= $snortloglimitAlertsizeKB) { exec('/bin/echo "" > /var/log/snort/alert'); } post_delete_logs(); /* XXX: This is needed if snort is run as snort user */ //mwexec('/usr/sbin/chown snort:snort /var/log/snort/*', true); mwexec('/bin/chmod 660 /var/log/snort/*', true); } conf_mount_ro(); } ?>