Hey Kevin,
I did this and it worked .
tar gz the /var/ossec directory on the similar Almalinux sever (same version AlmaLinux release 8.7 (Stone Smilodon)) which was running the wazuh-agent without imunify360 installed .
copied it to the server which had imunify360 installed .
extracted all the content in /opt/ directory .
then i had the directory /opt/ossec
ran the command to delete the files mentioned below which had the entry of the host where i copied the directory from
rm -f /opt/ossec/etc/client.keys
rm -f /opt/ossec/queue/syscollector/db/local.db
rm -rf /opt/ossec/queue/sockets/.agent_info
rm -rf /opt/ossec/queue/fim/db/fim.db
created a user wazuh with /sbin/nologin shell and /opt/ossec as the home directory
useradd -m -s /sbin/nologin -d /opt/ossec wazuh
This created the user wazuh
Well i have to set a password , set a complex password but since its a nologin shell it will take care of it for the time i figure it out how to manually create the user "wazuh" the correct method.
chown -R wazuh:wazuh /opt/ossec
ran the command
# /opt/ossec/bin/wazuh-control start
Starting Wazuh v4.3.10...
Started wazuh-execd...
Started wazuh-agentd...
Started wazuh-syscheckd...
Started wazuh-logcollector...
Started wazuh-modulesd...
Completed.
# /opt/ossec/bin/wazuh-control status
wazuh-modulesd is running...
wazuh-logcollector is running...
wazuh-syscheckd is running...
wazuh-agentd is running...
wazuh-execd is running...
And my wazuh-agent started reporting to the wazuh manager without ant issues having the imunif360 run along side the wazuh-agentd service
Now i have to figure out
1. make systemctl script for wazuh-agentd
2. enable at boot
3. If this worked then compiling the binaries from the source for a particular Operating system and then moving the binaries to their respective directories wil work too.
4. creating wazuh user the proper way to keep it secure.
Hope this helps some one who is looking for a solution for two ossec instance run on the same server side by side.
Best regards
./shri