I have used the code given and edited some parts and implemented the code in my servers . The code implemented was given below:
Code:
#Report file format for all the servers to grep the threshold reached files ( Script name : Report.sh)
df -g | awk 'NR>1&&($4+0)>70' > report010.txt
if [ -s report151.txt ]
then
cat report010.txt >> report010.txt
else
echo "No file systems found above 70% utilization on the server `hostname`">>report010.txt
fi
Code:
#Concatenating all reports in one mail (Script name: Mail.sh)
echo > blank_line
echo “The list of File systems that reached threshold were given below” > mailbody.txt
echo “---------------------------------------------------------------------------------“>>mailbody.txt
cat report010.txt blank_line report011.txt >>mailbody.txt|mailx -s "Disk space Report-$(date +'%A %B %d, %Y')” –r “DSReport@office.com” hariharan.s@office.com
And i Got the output as below
Code:
From: DSReport@office.com [mailto:DSReport@office.com]
Sent: Thursday, August 08, 2013 6:33 PM
To: Sundaram, Hariharan
Subject: Disk space Report-Thursday August 08, 2013
The list of File systems that reached threshold were given below
--------------------------------------------------------------
Disk space report for vathpubs010
/dev/hd2 5.88 1.76 71% 61014 13% /usr
/dev/fnetwebc_lv 2.00 0.34 84% 3558 5% /opt/IBM/FileNet/WebClient
Disk space report for vathpubs011
/dev/fnetwebc_lv 2.00 0.34 84% 3558 5% /opt/IBM/FileNet/WebClient
No Issues to report for the server vathpubs012
No Issues to report for the server vathpubs013
No Issues to report for the server vathpubs014
Disk space report for vathpubs015
/dev/fnetwebc_lv 2.00 0.34 84% 3558 5% /opt/IBM/FileNet/WebClient
Disk space report for vathpubs016
/dev/fnetwebc_lv 2.00 0.34 84% 3558 5% /opt/IBM/FileNet/WebCli
No Issues to report for the server vathpubs017
No Issues to report for the server vathpubs018
I have achieved the goal , but there was some additional request requested by my leads, They want the output like the above but some little modifications required, thats is We got the output but They need the "Disk space report for" (with filesystem) sorted first and then the "no issues to report" these servers should come like " The list of servers which are not having issues are given below: " with the servernames below.
For example :
The list of servers thats not facing the space issue are:
vathpubs017
vathpubs018
So is there any possibilities to bring this output? Please help me .
Hi
I'm trying to install gcc and the installation program tells me that I'm out of disk space! I have just installed the os (using the default settings for partitions and sizes) and have only installed apache on the machine. Can it really be out of disk space already?
How do I check how much... (4 Replies)
I know I have posted this question before, but I still just don't understand how to determine disk space. This server is an IBM RS6000 running on AIX version 4.2.1.
I in essence need to know the following if anyone can assist me.
1) I need to know how many drives are configured in the... (2 Replies)
Hello,
Can someone please tell me which command to use to determine the available disk space on a given disk device?
I have to write a shell script that compresses files and stores them in a specific location but I am not sure how "conservative" I should be?
Thanks in advance!
Al. (4 Replies)
Hi Experts.
I had 100% disk full , even though i have removed 2 GB space still dbf command shows 100%.
How to rectify that. Appreciate your prompt help. Thanks (1 Reply)
HI ...
I am New to the Unix...I am trying to write a script to check the disk space.
But i am not able to write it.
I know the command to check the disk space df -k,but unable to write the script..Can any body help me...
Thanks in advance... (3 Replies)
Hi
This is my script for disk space monitoring
clear
if
then
echo "You must be root user to execute the script"
fi
ALERT_LEVEL=10
CONSUMPTION_LEVEL= `df -k | awk {'print $5'} | cut -d '%' -f1 | sed "1 d"`
for i in $CONSUMPTION_LEVEL
do
FILE_SYSTEM=`df -k | awk {'print $1'} |... (3 Replies)
when i check
/export directory of my machine gets filled up (85%) i removed some old logs. but after cleaning df -k command still shows that /export is still 85% full.
Is there a way to force df to reflect actual free space without rebooting? My machine is a production one and can't... (8 Replies)
Hi,
I need help in writing unix script for checking space of some directories on the system and also send an email when it reaches the threshold limit.
I have written the followng code;
#!/bin/ksh
ADMIN="me@somewhere.com"
# set alert level 80% is default
THRESHOLD=80
df | grep -E... (5 Replies)
Hi,
I am new to shell scripting, and want to monitor disk space using shell script continously on server, which will shoot mail after crossing threshold limit
Please suggest.
Regards
Manoj (1 Reply)
Discussion started by: manoj.solaris
1 Replies
LEARN ABOUT MOJAVE
platform::shell
platform::shell(n) Tcl Bundled Packages platform::shell(n)
__________________________________________________________________________________________________________________________________________________NAME
platform::shell - System identification support code and utilities
SYNOPSIS
package require platform::shell ?1.1.4?
platform::shell::generic shell
platform::shell::identify shell
platform::shell::platform shell
_________________________________________________________________DESCRIPTION
The platform::shell package provides several utility commands useful for the identification of the architecture of a specific Tcl shell.
This package allows the identification of the architecture of a specific Tcl shell different from the shell running the package. The only
requirement is that the other shell (identified by its path), is actually executable on the current machine.
While for most platform this means that the architecture of the interrogated shell is identical to the architecture of the running shell
this is not generally true. A counter example are all platforms which have 32 and 64 bit variants and where a 64bit system is able to run
32bit code. For these running and interrogated shell may have different 32/64 bit settings and thus different identifiers.
For applications like a code repository it is important to identify the architecture of the shell which will actually run the installed
packages, versus the architecture of the shell running the repository software.
COMMANDS
platform::shell::identify shell
This command does the same identification as platform::identify, for the specified Tcl shell, in contrast to the running shell.
platform::shell::generic shell
This command does the same identification as platform::generic, for the specified Tcl shell, in contrast to the running shell.
platform::shell::platform shell
This command returns the contents of tcl_platform(platform) for the specified Tcl shell.
KEYWORDS
operating system, cpu architecture, platform, architecture
platform::shell 1.1.4 platform::shell(n)