Popular Posts

Showing posts with label sendmail. Show all posts
Showing posts with label sendmail. Show all posts

Jan 31, 2018

File system utilization report in mail


File system utilization report in mail

Issue :
Very often file systems are filled with application logs and other data,This space filling makes the server to panic for the servers which do not have proper monitoring in place.

Goal :
Deploy a  script to monitor the file systems usage with a defined threshold and to notify the support team and application team to clear the space.

Solution :
A script has been created to monitor the File System usage with a threshold of 85%, This script will run in cron every 30 minutes and send a mail to mentioned mail ID's if any of the File System is more than 85%

#!/bin/ksh
#disk_usage.sh - Monitor the disk usage and alert the support/applicaiton team
################################
#       Begin               
#       Author : Roselin John
#       Version 0.1
# -
# -
# -
# -
# -
################################

HOST=`uname -n`
> /root/scripts/disk_log
> /root/scripts/disk_log.txt
df -k | sed '1d' | awk '{ if ($5> 85) {print "Filesystem", $6, "on Server '$HOST' is", $5, "used, Please clear space"}}' > /root/scripts/disk_log
if [ -s /root/root_scripts/disk_log ] ; then
unix2dos /root/root_scripts/disk_log /root/scripts/disk_log.txt
mailx -s "Disk Monitor Alert" judi@gmail.com < /root/scripts/disk_log.txt
fi


Update the below entry in cron
30 * * * * /root/scripts/disk_usage.sh 2>&1

File System Monitoring
File System Monitoring script
Monitor File system changes
filesystem usage

Nov 17, 2016

Setup / configure sendmail client in solaris 11

Setup / configure sendmail client in solaris 11


1. Stop sendmail service
  svcadm disable -t network/smtp:sendmail

2. Verify the sendmail service status
svcs -a network/smtp:sendmail

3. Make a copy of the configuration files that you are changing.
cd /etc/mail/cf/cf
cp sendmail.mc `uname -n`.mc        (EX) cp sendmail.mc `uname -n`.mc

4. Edit the new configuration file (for example, vi judi-dev-01.mc), Add the below Line
MASQUERADE_AS(`mail.server-mycompany.co.in') {mail.server-mycompany.co.in - our mail server name}

5. Build the configuration file by using m4.
make `uname -n`.cf

6. Test the new configuration file by using the -C option to specify the new file.
/usr/lib/sendmail -C `uname -n`.cf -v judi.rose@sagariah.com </dev/null
Only outgoing mail can be tested without restarting the sendmail service on the system

7. Install the new configuration file after making a copy of the original
cp /etc/mail/sendmail.cf /etc/mail/sendmail.cf.`date +%d-%b-%Y-%H-%M`
cp `uname -n`.cf /etc/mail/sendmail.cf

8. Restart the sendmail service.
svcadm enable network/smtp:sendmail

9. Send a Test Mail
/usr/bin/mailx -s "Test Mail" -v judi.rose@sagariah.com < /dev/null

10. Send a Mail with a attachment
uuencode result.txt result.txt | mailx -s "Configuration - Audit Rport" judi@gmail.com


11. Test mail server connectivity
telnet mailserver.com 25



~
How to Set Up Mail Client
How to Set Up SendMail Client
configure sendmail client in solaris 11
sendmail in solaris 11
send mail in solaris 11
send mail client in solaris
solaris mail client
mailx configuration
~

Popular Posts