Flux rss

[Linux]Having a daily report of servers by mail

Published by jak58, last update on Wednesday October 29, 2008 06:26:28 AM by jak58

[Linux]Having a daily report of servers by mail






The monitoring and administration of Linux systems is a very difficult task when there is large number of interconnected servers, system resources and updates to each of them it,must continually monitored.

The following script creates a daily report intended to be sent by mail to the administrator.

Report content: Hard disk status and updates necessary (for Debian based system).
For other systems you must adapt to the existing systems management packages.

#!/bin/bash
apt-get update
( 
        echo To: receiver@domain.ext
        echo From: system@domain.net
 if [ "$( df -h | grep hda1 | cut -c40-42)" -ge "80" ]; then echo Subject: Reporting of `date +%e\ %B\ %Y` : LOW DISK SPACE
 else echo Subject: Daily reporting of `date +%e\ %B\ %Y` for `hostname`
 fi
        echo Reporting of `hostname`
        echo Disk used :
        echo 
        df -h
        echo
        echo Server charge :
        echo
        uptime
        echo
        echo Necessary updates
        echo
        apt-get -s upgrade
) | /var/qmail/bin/qmail-inject -fsenderr@domaine.ext receiver@domaine.ext

The above script will display a warning in the message if the hda1 disc has a filling rate greater than 80%. The messaging system used for sending in the example is qmail, but any other similar command (eg / usr / sbin / sendmail) can be used.

To make the script executable:

chmod +x /home/user/script/dailyreport.sh


Finally, creating an entry in the crontab will send daily by mail message (e.g. below 5:00 am):

crontab –e


Insert the following command line:

00 5 * * * /home/user/script/dailyreport.sh > /dev/null 2>&1
Club-Internet - Parameters POP Server: pop3.club-internet.fr IMAP Server: imap.club-internet.fr SMTP Server: mail.club-internet.fr Primary DNS: 194.117.200.10 Secondary DNS: en.kioskea.net/utile/club-internet.php3
Outlook setup Hi, I need to Setup my Outlook to receive my Hotmail mails directly on my pc, I am getting some problems what must in put in the Incoming / Outgoing server mail server ( Pop3) i included hotmail.com but i am not receiving anything When i click on Test... en.kioskea.net/forum/affich-12677-outlook-setup
NOOS - Settings POP server: pop.noos.fr IMAP server: imap.noos.fr SMTP server: mail.noos.fr Primary DNS: 212.198.0.91 Secondary DNS: 212.198.2.5 en.kioskea.net/utile/noos.php3
RCP Server not availableRCP Server not available RCP stands for Remote Procedure Call and if the computer displays “Operation could not be completed. The RPC server is unavailable” while trying to access the printers installed on the computer or trying to... en.kioskea.net/faq/sujet-356-rcp-server-not-available
Verifying the domain of an e-mail addresseVerifying the domain of an e-mail addresse There are two parties for an email addresse : the username and the domain name username@domain The domain part defines a set of associated machines in which it requires a server for... en.kioskea.net/faq/sujet-889-verifying-the-domain-of-an-e-mail-addresse
Free alternatives for Microsoft OutlookFree alternatives for Microsoft Outlook Outlook is a mail client allowing you to your read and send email by connecting to the server on which your account exists. This is done either by accessing your account via POP (Post Office Protocol)... en.kioskea.net/faq/sujet-430-free-alternatives-for-microsoft-outlook
DNS SERVER NOT WORKING!!Hello, I am new to DNS servers. I have been working on this for about two weeks now so if i seem frustrated please understand. =) All I wish to accomplish is being able to type in http://www.dv6500321123.com into an internet browser and have it pull... en.kioskea.net/forum/affich-19847-dns-server-not-working
Custom date formatHello, i need to change the format of dates in excel to read as 1st September 2008 2nd September 2008 and so on en.kioskea.net/forum/affich-26734-custom-date-format
MAIL SERVER ISSUEShello I have a 2003sp2 domain controller (one network card) .I use is as my mail server with microsoft exchange 2003 sp2 and webserver.I dont have a static address so I use No-ip service to map my dynamic ip.I live in Canada so I have rogers and on... en.kioskea.net/forum/affich-38091-mail-server-issues
Download PopcornPopcorn is a ultra-lightweight POP3/SMTP e-mail client.It will work as a client/server application, reading mail "directly" from POP3 servers. Popcorn requires no installation, no data is saved locally other than a portable .INI file containing... en.kioskea.net/telecharger/telecharger-229-popcorn
Download PIMEXPIMEX is an organizer and a personal information manager. It allows you to create your address book, mailing list, book notes and diary. It proposes a calendar with an alarm that will let you schedule appointments, manage tasks and prepare daily... en.kioskea.net/telecharger/telecharger-1361-pimex
US consumers lose record dollars to Internet criminals: FBIA man checks his Hotmail e-mail account at a cyber cafe. Fewer Americans fell for Internet fraudsters last year but those who did parted with a record 239.09 million dollars (152.5 million euros), an annual report by the FBI said Thursday. Fewer... en.kioskea.net/actualites/us-consumers-lose-record-dollars-to-internet-criminals-fbi-10261-actualite.php3
India says no security threat from BlackBerry: reportA woman sends text messages on her Blackberry phone. BlackBerry mobile devices do not pose a security threat and no permission is needed from the Indian government to make the service available, an official said Wednesday, according to media reports.... en.kioskea.net/actualites/india-says-no-security-threat-from-blackberry-report-10505-actualite.php3
Intranet - Installing a mail server The most commonly used e-mail server in Linux is Sendmail; however, as it is very hard to configure, we will use Qmail, an alternative e-mail server, instead. Qmail is made up of a group of programs that work with different UID/GIDs, in order to... en.kioskea.net/intranet/resmail.php3
Attacks - Mail bombing E-mail bombing involves sending several thousand identical messages to an electronic mailbox in order to overflow it. E-mails are stored on a messaging server until they are picked up by the owner of the messaging account. In this case, when the... en.kioskea.net/attaques/mailbombing.php3
Network equipment - Proxy servers A proxy server is a machine which acts as an intermediary between the computers of a local area network (sometimes using protocols other than TCP/IP) and the Internet Most of the time the proxy server is used for the web, and when it is, it's an HTTP... en.kioskea.net/lan/proxy.php3