Sponsored Content
Full Discussion: Disk space threshold report
Top Forums Shell Programming and Scripting Disk space threshold report Post 302842093 by Kalaihari on Thursday 8th of August 2013 12:16:15 PM
Old 08-08-2013
Disk space threshold report

Hi All,

I have a code which will give me the result of the diskspace which reached the threshold limit 70% and am redirecting it to report.txt . The code is given below.

Code:
df -g | awk '+$4 >= 70 {print}' >report.txt

Now i need your help , I need to use IF ELSE condition statment for getting the output as expected. If it reaches the threshold i should get the output which i will get for the above code, But if the server din face any threshold issues i should get the output as "No issues to report".

So In IF condition " Filesystems with 70% and more should get printed" in ELSE condition " If there is no threshold issues it should print like " NO ISSUES" ..

help needed immediately. Thanks for the help in advance
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Out of disk space?

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)
Discussion started by: alfabetman
4 Replies

2. Filesystems, Disks and Memory

Disk Space -

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)
Discussion started by: Docboyeee
2 Replies

3. UNIX for Dummies Questions & Answers

available disk space on disk device???

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)
Discussion started by: alan
4 Replies

4. HP-UX

Disk Space

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)
Discussion started by: test10002
1 Replies

5. Shell Programming and Scripting

Disk Space

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)
Discussion started by: Kingkon
3 Replies

6. Shell Programming and Scripting

Disk Space

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)
Discussion started by: chrs0302
3 Replies

7. Red Hat

disk space

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)
Discussion started by: aboorkuma
8 Replies

8. Shell Programming and Scripting

Check space of directories and send email if it has reached threshold limit

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)
Discussion started by: jmathew99
5 Replies

9. Shell Programming and Scripting

disk space

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
PAPI_overflow(3)						       PAPI							  PAPI_overflow(3)

NAME
PAPI_overflow - Set up an event set to begin registering overflows. SYNOPSIS
Detailed Description PAPI_overflow() marks a specific EventCode in an EventSet to generate an overflow signal after every threshold events are counted. More than one event in an event set can be used to trigger overflows. In such cases, the user must call this function once for each overflowing event. To turn off overflow on a specified event, call this function with a threshold value of 0. Overflows can be implemented in either software or hardware, but the scope is the entire event set. PAPI defaults to hardware overflow if it is available. In the case of software overflow, a periodic timer interrupt causes PAPI to compare the event counts against the threshold values and call the overflow handler if one or more events have exceeded their threshold. In the case of hardware overflow, the counters are typically set to the negative of the threshold value and count up to 0. This zero-crossing triggers a hardware interrupt that calls the overflow handler. Because of this counter interrupt, the counter values for overflowing counters may be very small or even negative numbers, and cannot be relied upon as accurate. In such cases the overflow handler can approximate the counts by supplying the threshold value whenever an overflow occurs. _papi_overflow_handler() is a placeholder for a user-defined function to process overflow events. A pointer to this function is passed to the PAPI_overflow routine, where it is invoked whenever a software or hardware overflow occurs. This handler receives the EventSet of the overflowing event, the Program Counter address when the interrupt occured, an overflow_vector that can be processed to determined which event(s) caused the overflow, and a pointer to the machine context, which can be used in a platform-specific manor to extract register information about what was happening when the overflow occured. C Interface: #include <papi.h> int PAPI_overflow (int EventSet, int EventCode, int threshold, int flags, PAPI_overflow_handler_t handler ); (*PAPI_overflow_handler_t) _papi_overflow_handler (int EventSet, void *address, long_long overflow_vector, void *context ); Fortran Interface: Not implemented Parameters: EventSet -- an integer handle to a PAPI event set as created by PAPI_create_eventset EventCode -- the preset or native event code to be set for overflow detection. This event must have already been added to the EventSet. threshold -- the overflow threshold value for this EventCode. flags -- bitmap that controls the overflow mode of operation. Set to PAPI_OVERFLOW_FORCE_SW to force software overflowing, even if hardware overflow support is available. If hardware overflow support is available on a given system, it will be the default mode of operation. There are situations where it is advantageous to use software overflow instead. Although software overflow is inherently less accurate, with more latency and processing overhead, it does allow for overflowing on derived events, and for the accurate recording of overflowing event counts. These two features are typically not available with hardware overflow. Only one type of overflow is allowed per event set, so setting one event to hardware overflow and another to forced software overflow will result in an error being returned. handler -- pointer to the user supplied handler function to call upon overflow address -- the Program Counter address at the time of the overflow overflow_vector -- a long long word containing flag bits to indicate which hardware counter(s) caused the overflow *context -- pointer to a machine specific structure that defines the register context at the time of overflow. This parameter is often unused and can be ignored in the user function. Return values: PAPI_OK On success, PAPI_overflow returns PAPI_OK. PAPI_EINVAL One or more of the arguments is invalid. Most likely a bad threshold value. PAPI_ENOMEM Insufficient memory to complete the operation. PAPI_ENOEVST The EventSet specified does not exist. PAPI_EISRUN The EventSet is currently counting events. PAPI_ECNFLCT The underlying counter hardware cannot count this event and other events in the EventSet simultaneously. Also can happen if you are trying to overflow both by hardware and by forced software at the same time. PAPI_ENOEVNT The PAPI event is not available on the underlying hardware. Example * // Define a simple overflow handler: * void handler(int EventSet, void *address, long_long overflow_vector, void *context) * { * fprintf(stderr, * address,overflow_vector); * } * * // Call PAPI_overflow for an EventSet containing PAPI_TOT_INS, * // setting the threshold to 100000. Use the handler defined above. * retval = PAPI_overflow(EventSet, PAPI_TOT_INS, 100000, 0, handler); * See Also: PAPI_get_overflow_event_index Author Generated automatically by Doxygen for PAPI from the source code. Version 5.2.0.0 Tue Jun 17 2014 PAPI_overflow(3)
All times are GMT -4. The time now is 07:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy