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; if (!is_array($config['installedpackages']['snortglobal']['rule'])) return; $snortloglimitDSKsize = exec('/bin/df -k /var | grep -v "Filesystem" | awk \'{print $4}\''); foreach ($config['installedpackages']['snortglobal']['rule'] as $value) { $if_real = snort_get_real_interface($value['interface']); $snort_uuid = $value['uuid']; $snort_log_dir = "/var/log/snort/snort_{$if_real}{$snort_uuid}"; if (file_exists("{$snort_log_dir}/alert")) { $snortlogAlertsizeKB = snort_Getdirsize("{$snort_log_dir}/alert"); $snortloglimitAlertsizeKB = round($snortlogAlertsizeKB * .70); $snortloglimitsizeKB = round($snortloglimitsize * 1024); /* do I need HUP kill ? */ if (snort_Getdirsize($snort_log_dir) >= $snortloglimitsizeKB ) { conf_mount_rw(); if ($snortlogAlertsizeKB >= $snortloglimitAlertsizeKB) @file_put_contents("{$snort_log_dir}/alert", ""); snort_post_delete_logs($snort_uuid); conf_mount_ro(); } } } ?>