Reputation: 442
Team,
Below is the shell code, which should send events to syslog and when I ran below code, it does not appear any error but when I check /var/log/messages it does not show up.
#!/bin/bash
# Iterate through all systemctl services and check their status
services=$(systemctl list-unit-files --type=service --no-legend | awk '{print $1}')
for service in $services
do
status=$(systemctl is-active $service)
# Send logs to rsyslogd
echo "$service: $status" | /usr/bin/logger -t "ServiceStatus" -p user.error
done
Due to this azure monitor logs not pushing to server
I have CBL Mariner linux it is working, In cent OS it is not working
Not working OS details:
os: cent os 7
rsyslog-8.24.0-57.el7_9.3.x86_64
rsyslog-gnutls-8.24.0-57.el7_9.3.x86_64
Upvotes: 0
Views: 150