How to send an email through python script

The smtplib module is used to send an email using the python script. Below is a sample python script to send an email #!/usr/bin/python import smtplib SMTP_HOST = “smtp hostname or ipaddress” FROM = “[email protected]” TO = [“[email protected]”] # must be a list SUBJECT = “Hello!” # Message message = “””\ From: %s To: %s…

How to send an email with attachment through Shell script

When we run cron for sending disk, cpu or memory alerts, we are supposed to send an email with those alerts. Below is the quick way to send an email with attachments through shell script. #!/bin/bash # Subject of an email SUBJECT=”Test email with attachment from a bash script” # Which address to send TO_ADDRESS=”[email protected]”…

How to configure Nagios on RHEL 6/CENTOS 6 from source

Nagios is a powerful server monitoring, network monitoring and remote infrastructure monitoring software application tool in the opensource community. Some of the many features of Nagios include: Monitoring of network services (SMTP, POP3, HTTP, NNTP, PING, etc.) Monitoring of host resources (processor load, disk usage, etc.) Automatic log file rotation Support for implementing redundant monitoring…