Hi,
I've got Wazuh 4.3 installed on 2 Oracle Linux 8.6 servers (1 Indexer and 1 Manager/Dashboard). I'd like to monitor disk usage and send an email when usage is 90%. I'm testing this on Wazuh
Indexerserver.
Default rule 531 is triggered when usage is 100%.
I've opened /var/ossec/etc/rules/local_rules.xml and copied these lines at the end of the file:
<group name="Wazuh disk monitoring">
<rule id="531" level="7" ignore="7200" overwrite="yes">
<if_sid>530</if_sid>
<match>ossec: output: 'df -P': /dev/</match>
<regex>57%</regex>
<description>Partition usage reached 57% (disk space monitor).</description>
<group>low_diskspace,pci_dss_10.6.1,</group>
</rule>
</group>
For the test purposes threshold is 57% because this is the disk usage on Wazuh Indexer server (Wazuh agent is installed on the server):
[root@indexer ~]# df -P
Filesystem 1024-blocks Used Available Capacity Mounted on
/dev/sda2 15718400 8941744 6776656 57% /
Running wazuh-logtest gives me the following output:
[root@manager]# /var/ossec/bin/wazuh-logtest
Starting wazuh-logtest v4.3.9
Type one log per line
ossec: output: 'df -P': /dev/sda2 15718400 8940388 6778012 57% /
**Phase 1: Completed pre-decoding.
full event: 'ossec: output: 'df -P': /dev/sda2 15718400 8940388 6778012 57% /'
**Phase 2: Completed decoding.
name: 'ossec'
**Phase 3: Completed filtering (rules).
id: '531'
level: '7'
description: 'Partition usage reached 57% (disk space monitor).'
groups: '['Wazuh disk monitoringlow_diskspace']'
firedtimes: '1'
mail: 'False'
pci_dss: '['10.6.1']'
**Alert to be generated.
This seems fine.
I've then restarted Wazuh agent on Wazuh Indexer server and checked the /var/ossec/logs/archives/archives.log file. There I see this line:
2023 Jan 09 14:42:23 (indexer.localdomain) any->df -P ossec: output: 'df -P': /dev/sda2 15718400 8941816 6776584 57% /
I've enabled the logall option in ossec.conf file: <logall>yes</logall>
So the alert is not generated.
What am I missing here? Why
rule.id 531 is not triggered when disk usage is checked on the server?
Regards