I have written the shell script which returns the result of the disk space filesystems which has crossed the threshold limit in HTML Format. Below mentioned is the script which worked perfectly on QA system.
I have made the below changes to make the script generates a HTML report. Now I need your help . If the filesystems crossed the threshold matching the below code , as per the code it should create a DSReport.html file or else it should create a text file stating that NO ISSUES REPORTED on the server.
Just for the record: df -Ph is a bit schizophrenic, because -P asks for output in POSIX-format and -h asks for output in "human readable" format (whatever that may be in Linux, i personally find the changing units annoying, but that is probably personal taste).
For portable scripts it is recommended to only use -P and to parse the output it generates. This will be the same not only in different versions of Linux but also other (POSIX-compliant) UNIX-systems.
Hi ,
The Output for the code which we modified is printing along with a 1 in the top and bottom. PFB result for reference. How to avoid printing 1 in the top and bottom of the result or else script works perfectly fine.
Look into the code you posted for something with a print in it and an XVAL . Comment out those lines and test. You may need to keep printing the "</tr>" , though.
and the diskspace script should monitor the inputs from the filesystem and send email only when critical limit reached the percentage mentioned or else it should not.
the email format should be in HTML format.
In my script, I have provided all inputs in a single shell file. BUt they need a property file as input now instead of hard coding in a single shell file.
please help me out with one script and how to bring the input file inside and trigger the email _/\_
You told us that you wrote the code you showed us in post #1 in this thread. It doesn't produce exactly the output that you want, but it does show that the author of that code had a basic understanding of coding principles.
You were given some code that seems to do what you wanted. You modified that code to add some debugging output.
You have been told exactly what is wrong in your code.
You have been told how to easily fix your code.
And yet you are unwilling or unable to remove one word from one line in your code and to remove one other line of code. (Even when the word and line that need to be removed are text that you added.)
Did you write the code you showed us in post #1? Is fixing this code part of a homework assignment?
We are here to help you learn how to write your own code; not to act as your unpaid programming and secretarial staff.