From cf83d1cb869a5c2a53d3a948e9193c152261fec6 Mon Sep 17 00:00:00 2001 From: Pete Date: Fri, 2 Feb 2024 12:25:16 -0500 Subject: [PATCH] feat: use mountpoint for Elastic log limit Instead of just existence, this checks if the directories are separate mountpoints when determining disk size and log_size_limit calculations. It also sets the percentage to 80 if /nsm/elasticsearch is a separate mountpoint. This allows for better disk utilization on server configurations where /nsm is based on large slow HDDs for increased PCAP retention but /nsm/elasticsearch is based on SSDs for faster Elasticsearch performance. --- setup/so-functions | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/setup/so-functions b/setup/so-functions index d19f27620..3caf76c06 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -2148,11 +2148,12 @@ set_default_log_size() { esac local disk_dir="/" - if [ -d /nsm ]; then + if mountpoint -q /nsm; then disk_dir="/nsm" fi - if [ -d /nsm/elasticsearch ]; then + if mountpoint -q /nsm/elasticsearch; then disk_dir="/nsm/elasticsearch" + percentage=80 fi local disk_size_1k