Automated script to email the vpn ccu license usage
Hi ,
We have the requirement to monitor the VPN CCU licenses on the F5 APM. At this point we manually run the command every hour generate the report. To automate the task , we have added a small script to the cron.hourly to send us an email. For some reason we do not receive the email. If we run the script manually at /var/tmp , it does send the email.
We took the tcpdump during the top of the hour , we noticed the recipient address picked by the cron job is different. We noticed its postmaster@devicehostname.
Not sure how this new email address is kicking in. As per the script, we do the file is getting generated in /var/tmp every hour.
Here is the script we added to cron.hourly
---------------------------------------------------------------------------------------------------------------------------------------------
#!/bin/sh
tmsh show apm license |grep 'total connectivity sessions\|current connectivity sessions' >
from="networking"
to="user@abc.com"
subject="APM Stats Report"
mail -s "$subject" -r "$from" -a "/var/tmp/apm-stats.txt" "$to" << EOF
Hi Team,
Please find the attached APM Stats report.
Thanks & Regards,
vpn device name
EOF
---------------------------------------------------------------------------------------------------------------------------------------------
It would be a great help if someone can guide me with the solution.
Thanks,
Reddy