Script to alert when File system has passed 87% of its capacity

Hi All
I am new to solaris, please can you help write a script to put in a cron job to alert me via email when a file system reaches +87% ?
Your help will be appreciated.
regards
F.R.

With pleasure, see comments with# on each line.
export TMP_MAILFILE=/tmp/fs_mail.txt *# This sets path and filename variable for mail text file*
echo "`uname -n` - Following filesystems are using more than 80% space\n" > $TMP_MAILFILE *# Writing mail subject to the mail text file*
df -h|egrep -v "Filesystem|:"|tr -d '%'|awk '{if($5 >= 80) print $6" "$2" "$3" "$4" "$5"%"}' >> $TMP_MAILFILE # here it takes values from df command. condition is if $5 is greate than or equal to 80%, it takes values of Filesystem name ($6), filesystem size $2, space currently used $3, space left for usage (availability) $4 and % occupied #5 and included % symbol for $5.
LC=`wc -l $TMP_MAILFILE|awk '{print $1}'` # storing the line count of the mail text file
if [ -s $TMP_MAILFILE ] # checking the mail text file size is not zero or blank
then
if [ $LC -gt 2 ] # on this condition, if line count of mail text is greate than 2, it will email the user, else, it will exit without alerting
then
mailx -s "`uname -n` Filesystem Alert" <email-id> (or) <mail alias from /etc/alias> < $TMP_MAILFILE # mailx is the utility/command used to send mail. -s is subject. Check "man mailx" for more details.
fi # end loop 2
fi # end loop 1
Edited by: Soorya on Jun 23, 2011 2:48 AM
Edited by: Soorya on Jun 23, 2011 2:51 AM

Similar Messages

  • Sender File adpter --don't raise alerts when file does not exist in folder

    Hi,
    My Scenario is File --- >XI ---> SAP.
    I must archieve the file after it got polled. and iam polling for every 60 mins, if the file does not exist,it is throwing an alert like "Could not process file '.file..xml: No such file or directory '
    Is there any way i can avoid raising an alert if file does not exist in the source folder.
    we are on XI 3.0 sp23?
    Thanks
    Srini

    Hello,
    Your Subject:
    >Sender File adpter --don't raise alerts when file does not exist in folder
    is contradictory to your question.
    >if the file does not exist,it is throwing an alert like "Could not process file '.file..xml: No such file or directory '
    > Is there any way i can avoid raising an alert if file does not exist in the source folder.
    I know you want to say "Don't Raise alerts when file does not exist in folder". Correct me if I am wrong.
    Some times it happens, when we write the right thing but it means something else and this is the reason many experts have replied, "how to raise an alert". So if you remove the word "Sender File adapter" from your subject then it will be easy to understand the exact meaning.
    Regards,
    Sarvesh

  • Im running windows 7 64 bit. installed itunes 10.5.4.1 and now cds will not import or play. If i have the cd in the drive and then open itunes it will importor play but after removed the next disc will not read. the system has passed the cd/dvd test.

    Cd import/play problem. Downloaded itunes 10.5.. Cd will play and import when disc is present when itunes is opened. If itunes is open cd will not import or play. Itunes passed the cd/dvd test.
    Microsoft Windows 7 x64 Home Premium Edition Service Pack 1 (Build 7601) Dell Inc. Studio XPS 8100 iTunes 10.5.1.42 QuickTime not available FairPlay 1.13.36 Apple Application Support 2.1.5 iPod Updater Library 10.0d2 CD Driver 2.2.2.0 CD Driver DLL 2.1.3.0 Apple Mobile Device 4.0.0.97 Apple Mobile Device Driver 1.57.0.0 Bonjour 3.0.0.10 (333.10) Gracenote SDK 1.9.5.502 Gracenote MusicID 1.9.5.115 Gracenote Submit 1.9.5.143 Gracenote DSP 1.9.5.45 iTunes Serial Number 003AABF40351C940 Current user is an administrator. The current local date and time is 2011-12-01 17:19:39. iTunes is not running in safe mode. WebKit accelerated compositing is enabled. HDCP is supported. Core Media is supported. Video Display Information ATI Technologies Inc., ATI Radeon HD 5700 Series **** External Plug-ins Information **** No external plug-ins installed. iPodService 10.5.1.42 (x64) is currently running. iTunesHelper 10.5.1.42 is currently running. Apple Mobile Device service 3.3.0.0 is currently running. **** CD/DVD Drive Tests **** LowerFilters: PxHlpa64 (2.0.0.0), UpperFilters: GEARAspiWDM (2.2.2.0), D: HL-DT-ST DVD+-RW GH50N, Rev B103 Audio CD in drive. Found 16 songs on CD, playing time 72:03 on Audio CD. Track 1, start time 00:02:00 Track 2, start time 04:58:07 Track 3, start time 11:45:30 Track 4, start time 16:27:57 Track 5, start time 21:35:15 Track 6, start time 27:59:00 Track 7, start time 31:22:40 Track 8, start time 36:52:12 Track 9, start time 40:32:40 Track 10, start time 44:19:40 Track 11, start time 48:30:60 Track 12, start time 51:37:72 Track 13, start time 56:13:50 Track 14, start time 58:24:10 Track 15, start time 63:10:50 Track 16, start time 68:05:00 Audio CD reading succeeded. Get drive speed succeeded. The drive CDR speeds are:  4 8 16 24 32 40 48. The drive CDRW speeds are:  4. The drive DVDR speeds are:  4. The drive DVDRW speeds are:  4. Writing CD text is turned on in the preferences. If you’re having problems burning CDs, try turning this preference off
    I ve tried completely removing itunes and reinstalling. also unchecked autocorrect and find art and track names which did not work as well. Any ideas of how to fix this?

    Microsoft Windows 7 x64 Home Premium Edition Service Pack 1 (Build 7601) Dell Inc. Studio XPS 8100 iTunes 10.5.1.42 QuickTime not available FairPlay 1.13.36 Apple Application Support 2.1.5 iPod Updater Library 10.0d2 CD Driver 2.2.2.0 CD Driver DLL 2.1.3.0 Apple Mobile Device 4.0.0.97 Apple Mobile Device Driver 1.57.0.0 Bonjour 3.0.0.10 (333.10) Gracenote SDK 1.9.5.502 Gracenote MusicID 1.9.5.115 Gracenote Submit 1.9.5.143 Gracenote DSP 1.9.5.45 iTunes Serial Number 001CA97403888A88 Current user is not an administrator. The current local date and time is 2011-12-03 16:12:39. iTunes is not running in safe mode. WebKit accelerated compositing is enabled. HDCP is supported. Core Media is supported. Video Display Information ATI Technologies Inc., ATI Radeon HD 5700 Series **** External Plug-ins Information **** No external plug-ins installed. iPodService 10.5.1.42 (x64) is currently running. iTunesHelper 10.5.1.42 is currently running. Apple Mobile Device service 3.3.0.0 is currently running. **** CD/DVD Drive Tests **** LowerFilters: PxHlpa64 (2.0.0.0), UpperFilters: GEARAspiWDM (2.2.2.0), D: HL-DT-ST DVD+-RW GH50N, Rev B103 Audio CD in drive. Found 19 songs on CD, playing time 68:17 on CDROM-XA media. Track 1, start time 00:02:00 Track 2, start time 02:36:15 Track 3, start time 05:52:55 Track 4, start time 08:48:37 Track 5, start time 11:50:00 Track 6, start time 16:08:30 Track 7, start time 19:21:52 Track 8, start time 23:31:17 Track 9, start time 28:27:45 Track 10, start time 32:05:00 Track 11, start time 35:40:32 Track 12, start time 39:10:30 Track 13, start time 43:50:25 Track 14, start time 47:11:10 Track 15, start time 50:32:47 Track 16, start time 56:31:25 Track 17, start time 60:03:10 Track 18, start time 62:37:37 Track 19, start time 64:55:62 Audio CD reading succeeded. Get drive speed succeeded. The drive CDR speeds are:  4 8 16 24 32 40 48. The drive CDRW speeds are:  4. The drive DVDR speeds are:  4. The drive DVDRW speeds are:  4. Writing CD text is turned on in the preferences. If you’re having problems burning CDs, try turning this preference off. Just turned pc on this is my test. Also dell has included a temp read in the dell support center. temp is 30 right now. Also listed was  the max temp. in the pcs lifetime as 43.

  • Trouble when file name has spaces

    In Windows XP's Windows Explorer, when I double click a .pdf file to open it the Adobe Reader comes up and then sometimes puts up a pop-up saying "There was an error opening this document. This file cannot be found". I have to click OK several times to get the pop-up to go down.
    After some internet investigation I discovered if the file's path name has spaces then Adobe breaks the path into pieces at the spaces and interprets it as several file names. The advice I found on the internet was to have the launching application put double quotes around the file name.
    The trouble is, in my case the launching application is Windows XP, and I don't know how to instruct it to add the double quotes.

    I WANT THE PASSWORD
    SAYS ANOTHER ACCOUNT WITH THE SAME ADDRESS
    I WANT THE PASSWORD

  • Mac File on NT server thows fnf exception when file name has special chars

    Help,
    I can get my code to work around this problem but I would like to be
    able to delete the offending file or run some logic on it but it just doesn't understand the file because of the file not found exception.
    Any suggestions ?
    Thanks in advance,
    Dan

    There are several entries in the Bug Database that sound like that. They may have been fixed in 1.4.

  • Auto Log off when a time has passed without logging back onto the Domain ??

    Morning World,
    I hope someone can help me, we are a high school with close to 800+ computers in school with Teacher laptops which they take home and use at home, that bits not the problem they log on at home with their domain user account and the same privileges/restrictions
    which they have in school, the issue we have is.... once they get the laptops home they never bring them back into school, thus updates are not installed, AV not updated, Anti mal not updated and so on... on our old domain (server 2003 and win xp clients) we
    had a vbs script which after a certain number of days warned them to bring it back to school, then again and then finally it disabled the laptop say after 55 days of it not being connected to the domain, however this was with a local user (Home) on the laptop,
    now they log on with a synchronised domain user account, is there a GPO or a vbs script that anyone knows of which will do the same ??
    Server 2012 r2
    Windows 7 enterprise clients
    many thanks have a nice day
    Andy

    Hi,
    Do you mean these users haven't log back to domain for a long time, then we can consider them as inactive users. we can temporarily disable these user accounts.
    I found some scripts which might be helpful for you
    Active Directory Inactive user and computer tool
    http://gallery.technet.microsoft.com/Active-Directory-Inactive-1527271c
    Inactive Users Script
    http://gallery.technet.microsoft.com/scriptcenter/Inactive-Users-Script-76eb43f4
    And this powershell script can also be helpful
    PowerShell script to disable inactive accounts in Active Directory
    http://blogs.technet.com/b/bahramr/archive/2008/01/25/powershell-script-to-disable-inactive-accounts-in-active-directory.aspx
    Yolanda Zhu
    TechNet Community Support

  • Database Control: File System Alert -

    I am using 10.2 on HP UNIX 11. My development database is installed on a server, which is hared by many other applications/database. DB Control sends me alerts when file system is more than 80% used or so. I do not want to receive any file system alerts because these file systems are not my file systems.
    I do not find any place to turn this alert off. Appreciate any help?

    Gee whiz. In this thread (Database Control: Not sending e-mail you were complaining about not* getting email for that same condition. You say "I do not want to receive any file system alerts because these file systems are not my file systems.
    " Some of the file systems are yours ... the ones holding $ORACLE_BASE and any fs holding any file even remotely related to your db ... .dbf files, redo logs, backup sets, archivelog files, bdump and other *dump directories.  I like to be notified if they go over 80%.

  • Find out when a program has been run

    Hi,
    To find out when a program has been run, I've developed a z program that uses FM SAPWL_STATREC_READ_FILE.
    However sometimes, the FM can't read the log file, and also I've known that a program was executed but it isn't on the tables return by the SAPWL_STATREC_READ_FILE.
    Can you help?
    Regards,
    Maria João Rocha

    As I understand, the file is deleted (and recreated) if it reaches the size specified in the parameter settings
    Following is an excerpt from help (do a search on 'statfile' in the help documentation..)
    "<b>Options for reorganizing statistical data (for all servers)</b>
    Delete seq. statfile after cumulation if size > (default: 100Mb).
    This parameter specifies from what file size the system should delete the statistics file. The statistics file is required for individual statistics and is therefore not deleted until the file size has passed a specified maximum file size. Of course, the file is only deleted if it was completely processed by RSSTAT80 or RSSTAT83 ..
    Max. no. of records cumulated per call (default: 20.000).
    This is the maximum number of entries in the statistics file that can be processed by RSSTAT80 or RSSTAT83 in one session. This parameter is used to restrict the runtime of the collector.
    Options for reorg of application statistic data (valid for all servers)
    <b>Delete appl. statfile after cumulation if size > (default: 30Mb).</b>
    This parameter specifies from what size the system should delete the application statistics file. Of course, the file is only deleted if it was completely processed by RSSTAT88 or RSSTAT89 .
    Max. number of records cumulated per call (default: 20.000).
    This is the maximum number of entries in the application statistics file that can be processed by RSSTAT80 or RSSTAT83 in one session. This parameter is used to restrict the runtime of the collector."

  • How do I identify the latest file modifications, application install, and registry key modification for Security Forensics.... using GP Audit for registry/file system

    Hello,
    Title pretty much states it all. I initially set out (as part of a Security Forensics initiative) to identify the most recently installed applications, modified files, and registry key changes using PowerShell. I attempted to pull this information and sort
    them by date installed/last modified, but it was brought to my attention this information isn't always present and can be modified - so it's not accurate.
    At that time it was suggested we use Group Policy auditing for Registry and File System -  but I'm not sure how I'm going to use/pull these in PowerShell? This will be used on remote host all over the world so local physical access isn't an option.
    My question is:
    Once Group Policy Auditing for Registry and File System has been enabled, how would I go about pulling those audit logs for review once a system has been identified as compromised? I'm brand new to this GP Auditing (we have a separate team for that) so feel
    free to take it from the beginning. :)
    Thanks in advance!

    Hi,
    Here are a few suggestions for you:
    Ensure Remote Registry service is started on local and remote machines.
    Add the – Credential option and supply administrative credentials within the command.
    More information for you:
    Get-Eventlog doesn't work against Vista/W7 clients
    https://social.technet.microsoft.com/Forums/en-US/c5185a01-b0d2-49a7-9aa7-52e6534ada04/geteventlog-doesnt-work-against-vistaw7-clients?forum=winserverpowershell
    PowerShell - How to Get XML EventData - Remote Eventlogs - Exchange Events
    https://social.technet.microsoft.com/Forums/scriptcenter/en-US/382b10c9-d740-46b1-b81c-b24de911eb14/powershell-how-to-get-xml-eventdata-remote-eventlogs-exchange-events-?forum=ITCG
    Powershell script to gather failed logon attempts by event id and type from the security events log
    https://social.technet.microsoft.com/Forums/scriptcenter/es-ES/00a62492-c63a-4c8b-92f9-1cc857223a00/powershell-script-to-gather-failed-logon-attempts-by-event-id-and-type-from-the-security-events-log?forum=ITCG
    Best Regards,
    Amy
    Please remember to mark the replies as answers if they help and un-mark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • SQL0968C The file system is full

    Hi All,
    In our BI pre-prod system we trying to test the BI data load.
    It stopped giving this error in SM21
    Database error -968 at FET
    SQL0968C The file system is full. SQLSTATE=57011
    Database error -968.
    Our BI is 7.0 version ,DB2 8.1, AIX 5.3.
    I checked in db2diag.log and found that temporary tablespace was full at that time.
    Following is some example from db2diag.log.
    2007-06-18-21.00.17.073907+060 E154034841A701     LEVEL: Error
    PID     : 528538               TID  : 1           PROC : db2pclnr 0
    INSTANCE: db2fbr               NODE : 000
    FUNCTION: DB2 UDB, buffer pool services, sqlbClnrAsyncWriteCompletion, probe:0
    MESSAGE : ADM6017E  The table space "PSAPTEMP16" (ID "3") is full. Detected on
              container "/db2/FBR/saptemp1/NODE0000/temp16/PSAPTEMP16.container000"
              (ID "0").  The underlying file system is full or the maximum allowed
              space usage for the file system has been reached. It is also possible
              that there are user limits in place with respect to maximum file size
              and these limits have been reached.
    But we tested the same load before with approximatly same amount of data but dont know why its giving the problem this time.
    How to solve this temporary tablespace issue is it require to increase the filsystem size. tablespace is in autoextent mode and fiesystem is still 20GB free.
    Regards,
    Manish

    Hi Manish,
    when looking at the error message <a href="http://publib.boulder.ibm.com/infocenter/db2luw/v9/topic/com.ibm.db2.udb.msg-search.doc/doc/sql0968-sch.htm?resultof=%22%53%51%4c%30%39%36%38%43%22%20%22%73%71%6c%30%39%36%38%63%22%20">SQL0968C</a>, the documentation states the following:
    SQL0968C
    The file system is full.
    Explanation:
    <b>One of the file systems containing the database is full. This file system may contain the database directory, the database log files, or a table space container.</b>
    The statement cannot be processed.
    User response:
    Free system space by erasing unwanted files. Do not erase database files. If additional space is required, it may be necessary to drop tables and indexes identified as not required.
    On unix-based systems, this disk full condition may be due to exceeding the maximum file size allowed for the current userid. Use the chuser command to update fsize. A reboot may be necessary.
    This disk full condition may be caused when containers are of varying sizes. If there is sufficient space in the file system, drop the table space and recreate it with containers of equal size.
    sqlcode: -968
    sqlstate: 57011
    Please check also the other filesystems that belong to the database, not only the one where PSAPTEMP16 is included.
    Check, if you are using quotas in your system.
    Kind regards
    Waldemar Gaida

  • WebLogic as Windows 2000 service over s shared file system

    I am trying to install weblogic as a Windows 2000 service over a
    shared file system with no sucess
    (the shared fie system is provided by windows 2000 cluster services).
    I am using the srvany utility to have the script that launches
    weblogic be run as a service (I need this
    because I must launch 2 instances of weblogic in the same machine
    as services, i cannot do this
    with the bea service tools, having different configurations for
    the classpath, or can I?)
    The service works if weblogic is not installed in a shared file
    system.
    On the shared file system, it fails (The service fails, is unabble
    to start). I also made a script on the local file
    system, that calls the weblogic script on the shared file system,
    but weblogic fails to start (with no
    message) when loading from the weblogic.classpath
    thanks for your attenction,
    Bruno Antunes
    WhatEverSoft - Java Center

    I have also tried running the service with the bea tools, with no
    sucess when running in
    the shared file system.
    When i start the service, it seems to start ok, then stops. with
    no message.
    Nothing is written to the log, any ideas?
    Bruno Antunes
    WhatEverSoft - Java Center

  • DBACOCKPIT storage information update when filesystem size has changed

    Hello Experts,
    I'm playing around with db2, linux and virtualization...
    I reduce the file system size where the /db2 is mounted on. Problem is that TC dbacokpit shows the same information under space->automatic storage -> summary  as before the file system was reduced. I understand that with automatic storage DB2 will grow as need, but
    what happen when file system is shrunk ??
    do I have to do something in order to have dbacockpit to show accurate informating regarding the real available space in the file system once its size has changed?
    is there any danger on having dbacockpit reporting wrong available space on the file system?
    thank you

    Hello,
    Validate if standard job SAP_COLLECTOR_FOR_PERFMONITOR is scheduled hourly, if not, schedule it in client 000 with DDIC user. Review logs too, maybe there is an error shown in job logs.
    Also, you should take a look to SAP Note 1508792: "Refresh does not work in DBACockpit" or  SAP Note 1002840: "No data or obsolete data in DB Space Statistic monitor" may be helpfull too.
    Best regards,
    Isabel

  • New zone and inherited file system mount point error

    Hi - would anyone be able to help with the following error please. I've tried to create a new zone that has the following inherited file system:
    inherit-pkg-dir:
    dir: /usr/local/var/lib/sudo
    But when I try to install it fails with:
    root@tdukunxtest03:~ 532$ zoneadm -z tdukwbprepz01 install
    A ZFS file system has been created for this zone.
    Preparing to install zone <tdukwbprepz01>.
    ERROR: cannot create zone <tdukwbprepz01> inherited file system mount point </export/zones/tdukwbprepz01/root/usr/local/var/lib>
    ERROR: cannot setup zone <tdukwbprepz01> inherited and configured file systems
    ERROR: cannot setup zone <tdukwbprepz01> file systems inherited and configured from the global zone
    ERROR: cannot create zone boot environment <tdukwbprepz01>
    I've added this because unknown to me when I installed sudo from sunfreeware in the global it requires access to /usr/local/var/lib/sudo - sudo itself installs in /usr/local. And when I try to run any sudo commands in the new zone it gave this:
    sudo ls
    Password:
    sudo: Can't open /usr/local/var/lib/sudo/tdgrunj/8: Read-only file system
    Thanks - Julian.

    Think I've just found the answer to my problem, I'd already inherited /usr ..... and as sudo from freeware installs in /usr/local I guess this is never going to work. I can only think to try the sudo version of the Solaris companion DVD or whatever it's called.

  • Requirement for Alert when outbound idocs are failing

    SAP A -
    IDOCS -
    >  SAP B
    We currently have a SAP A system sending outbound idocs to SAP B system via ALE. The current issue is when SAP B system is down. The outbound idocs being sent from SAP A system fail.
    We want to get a alert when the System B is down.
    What are the options available in SAP to achieve this requirement.
    Thanks in advance for any inputs that will be provided.
    Regards,
    Chandra Kumar

    Dear Chandra,
    The logical solution to the problem is as below,
    You need to have a Function module which checks the RFC connections between two systems before sending idoc. If the connection is found OK then the idoc should be send else a Alert message should be raised u201CSystem B is down, idoc can not be processedu201D
    Please let me know if this solution helped in resolving your query.
    Regards
    Dinesh

  • Security in  file system

    hi all
    i m creating new file in SIM file system & stroing some data in that
    file.now i want to secure that data by any unauthorized access.
    for that i need any of the keys like ADM o or any key that i can change permission of file from my applet & make it secure but n/w operater is not going to give me any of the keys.so its not possible according to me.
    m i correct?
    another thing, i can create any key on SIM & use one key on my STK applet ,to access secure file on SIM file system.
    or any other way , can i make file read/write to my applet only,no one other can read/write(access) my file.
    thanks & regards
    Divyesh.

    hi kartagos
    once again thank u for ur response,
    but i m still a bit confused.
    Yes, if you set the Access Domain to "Full Acess" ,
    your Applet can read and write any file, regardless
    of its ACL. BUT if the ACL is set to "never", no one
    can acess that file (Applet, user, Mobile, etc), take for granted that my file has only ADM access.
    in this case without ADM key ,can i invalidate & rehabiliate file from my applet?
    if i can do that then i will set file as invalidated bydefault ,then from my applet i will rehabililate it & then do read/write on that file from applet & again invalidate it from applet.So nobady can read/write the file a sit is invalidated & required ADM key to change ACL.
    as what i have marked GSM file system has read condition for all .& i don't want anybody to read my file accept my applet.
    it's
    the case of the file Ki : The read acess is set to
    "Never" so no Applet and no body can read the content
    of the EF Ki ( great ! )if above case not works,
    then what i can do that i create one new key set in key management.(like ki ,nobody can read it ) & put one key on my applet . i use key on SIM by key on applet for validation & then only i can perform any read/write operation on file.
    in nutshell
    can i protact file by key (like enter password before read/write)?
    is it possible?
    which can be the suitable case for me among the two cases?
    Thanks & regards
    Divyesh.

Maybe you are looking for