Sponsored Content
Top Forums Shell Programming and Scripting Send Disk Space Usage Status via email Post 302964253 by g4v1n on Wednesday 13th of January 2016 12:35:41 AM
Old 01-13-2016
Thanks Guys, I got it working by installing POSTFIX and MAILUTILS.
I write the following script to find out the disk space and put it into text file and I use php mail function to send it to my email Smilie I
Code:
#!/bin/bash
HB=/home/user/Desktop/heartbeat.txt
df | awk '{print $5}' | sed -ne 2p | cut -d"%" -f1 > $HB

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

awk to find the status and send an email

Hi, I have a datafile which has the following data and it can have much more records. The data set is as follows: ISA~00~ ~00~ ~ZZ~F159B ~ZZ~U1CAD ~051215~184 3~U~00200~000011432~0~P~< GS~FA~TC11A~U1CAD~051215~1843~000011432~X~002002 ST~997~0001... (6 Replies)
Discussion started by: isingh786
6 Replies

2. Shell Programming and Scripting

check the status and send an email with status

Hi, We have a text file which has the following data. ISA~00~ ~00~ ~ZZ~VISTN ~ZZ~U1CAD ~051227~183 7~U~00200~000011258~0~P~< GS~FA~EE05J~U1CAD~051227~1831~000011258~X~002002 ST~997~0001 AK1~SH~247 AK2~856~2470001 AK5~A AK2~856~2470002 AK5~A... (3 Replies)
Discussion started by: isingh786
3 Replies

3. UNIX for Dummies Questions & Answers

how to determine the disk space usage

how can we determine the disk space used by a certain directory? (1 Reply)
Discussion started by: gfhgfnhhn
1 Replies

4. Shell Programming and Scripting

Need to send email on HIGH Disk usage

Hi Guys I am looking for a python / PERL script which will send me email when ever my disk becomes more than 90% full. By the way my OS is Win XP. If anybody have already has written same type of script or something very similar kind of script, that will also be very helpful. Thanks... (1 Reply)
Discussion started by: csaha
1 Replies

5. Shell Programming and Scripting

shell script to send email with usage of space in the directory as description :

shell script to send email with usage of space in the directory as description : Please any one help me in writing a script to send email with usage of space in the directory as description . (3 Replies)
Discussion started by: sakthifire
3 Replies

6. Filesystems, Disks and Memory

Disk space and RAM status in UNIX

I have an application which is running under AIX, HP UNIX, SCO, and LINUX(redhat and SuSE). and its dealing with some bulk amount of file handling, and some of my boxes are not very good in terms of resources like memory and disk space. so i wanted to know the statistics of each of my boxes. Like... (2 Replies)
Discussion started by: renjithram
2 Replies

7. Shell Programming and Scripting

Disk Usage - Space Used

Hi all, FreeBSD7.1 @ sh. In a backup script I am trying to get the blocks used by the backup once completed. I am using the function: #!/bin/sh spaceused() { du -d 0 "${1}" | awk -F"+" '{ print $1 } } to return the blocks used of said directory and contents. Via. command line... (7 Replies)
Discussion started by: Festus Hagen
7 Replies

8. UNIX Desktop Questions & Answers

Issue with disk space usage

Issue with disk space usage I have the following line in my "df -h" output: Filesystem Size Used Avail Capacity Mounted on /dev/ad4s1a 496M 495M -39M 109% / What is the issue with having 9% excess utilisation? How can I find out what this partition is... (2 Replies)
Discussion started by: figaro
2 Replies

9. Shell Programming and Scripting

Help....script check status if see something then send email

autorep -m bogus Machine Name Max Load Current Load Factor O/S Status ___________ ________ ___________ ______ ________ ______ bogus --- --- 1.00 Sys Agent Online Status ______ Online Offline Missing Unqualified The "Status" always "Online". I like create a script execute run... (6 Replies)
Discussion started by: dotran
6 Replies

10. Shell Programming and Scripting

Generate disk space usage email alert

hi all members I have a shell script to generate disk space usage email alert if threshold is more than 80 %, now the requirement changed to keep sending alert emails for every 5% incremental usage ........ Any help would be greatly appreciated. ex - 80% , 85% ,90%,95%,100% we should get an... (6 Replies)
Discussion started by: anil529
6 Replies
MYTHTV-STATUS(1)					User Contributed Perl Documentation					  MYTHTV-STATUS(1)

NAME
mythtv-status - Display the status of a MythTV backend SYNOPSIS
mythtv-status [options] DESCRIPTION
This script queries a MythTV backend and reports on the status of it, any upcoming recordings and any which are happening right now. The intention is to warn you if there is a program being recorded or about to be recorded. OPTIONS
-c, --colour Use colour when showing the status of the encoder(s). -d, --description Display the description for the scheduled recordings. --disk-space-warn The threshold (in percent) of used disk space that we should show the disk space in red (if using colour) or send an email if we're in email mode with email only on warnings. --encoder-details Display the input ID and channel name against the recording details. --encoder-skip-idle Suppress displaying idle encoders in the Encoders block. -e, --episode Display the episode (subtitle) for the scheduled recordings. --email <address>[ --email <address> ...] Send the output to the listed email addresses. By default the encoder status, currently recording shows and time till next recording is surpressed from the email. To turn the additional blocks on you can use --encoders, --recording-now and/or --next-recording. --email-only-on-alert Only send an email out (if --email is present) if there is an alert (i.e., schedule conflict or low disk space). -?, --help Display help. --file <file> Load XML from the file specified instead of querying a MythTV backend. Handy for debugging things. --save-file <file> Save the XML we received from the MythTV backend. Handy for debugging things. --guide-days-warn <days> Warn if the number of days of guide data present is equal to or below this level. Default is 2 days. -h HOST, --host=HOST The host to check, defaults to localhost. --nostatus, --noencoders, --norecording-now, --noscheduled-recordings, --noschedule-conflicts, --nonext-recording, --nototal-disk-space, --nodisk-space, --noguide-data, --noauto-expire Suppress displaying blocks of the output if they would normally be displayed. -p PORT, --port=PORT The port to use when connecting to MythTV, defaults to 6544. --oneliner-bullets Insert asterisks (*) before each of the oneliners to stop some email clients from thinking the oneliner block is a paragraph and trying to word wrap them. --auto-expire Display the shows due to auto expire (output is normally suppressed). --auto-expire-count How many of the auto expire shows to display, defaults to 10. --recording-in-warn If the "Next Recording In" time is less than this amount, display it in red. This in seconds, and defaults to 3600 (1 hour). --verbose Have slightly more verbose output. This includes any warnings that might be generated while parsing the XML. -v, --version Show the version of mythtv-status and then exit. OUTPUT
The output of this script is broken up into several chunks they are: Status Some general info about the backend, currently just the timestamp of when this program was run. Guide Data The number of days of guide data is present. By default it is only shown if the number of days is below the warning level. To show it regardless of the warning level use --guide-data. Encoders Each encoder that the backend knows about are listed, with the hostname they are on, the encoder ID (in brackets) and the current status. Recording Now Any programs which are being recorded right now. Scheduled Recordings Up to 10 programs which are scheduled to be recorded today and tomorrow. Schedule Conflicts Any upcoming schedule conflicts (not just limited to today or tomorrow). Shows due to Auto Expire The shows which will be deleted and the order they'll be deleted if the auto expirer kicks in. Total Disk Space The amount of disk space in total, and used by MythTV. Next Recording In If there are no recordings currently happening, then the amount of time until the next recording is displayed. Disk Space Details about each storage group that MythTV knows about. By default this only shows storage groups that are above the warning level. Use --disk-space to turn on display of all storage groups. RETURN CODES
mythtv-status provides some return codes. 0 Standard return code 1 A warning is generated AUTHOR
Andrew Ruthven, andrew@etc.gen.nz LICENSE
Copyright (c) 2007-2009 Andrew Ruthven <andrew@etc.gen.nz> This code is hereby licensed for public consumption under the GNU GPL v3. perl v5.14.2 2012-12-20 MYTHTV-STATUS(1)
All times are GMT -4. The time now is 02:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy