Something like this: df -Ph /var/hadoop/hdfs | tr -d '%' |Īwk 'NR=2' & /opt/do_action. This job is added in cron to execute in a time frame. So this script is to monitor the disk space usage and wall message to the users about the disk space usage if it exceeds the limit set in the script. With that in mind, you can then set awk's exit status using exit() and use that with the regular shell & to execute your script. Some times my disk space is used upto 100 due to the application logs. So you don't need to grep hdfs, you can get it directly and then simply look at the second line ( NR=2 in awk) to skip the header. For example, on my system: $ df -Ph /home/terdonįilesystem Size Used Avail Use% Mounted on I received the mail as below.You can run df /path/to/directory to get the df output of that directory. To test it I had set the value to 200GB and my disk space was 106GB. You can show the disk space information of any particular folder in human readable format by using above command. T option is used with df command to show the file type. m option is used with df command to show the disk space in MB. | where FreeSpace < setgbvalue //setting condition to check if the value is less than our set value. Disk space value will be shown in GB and MB. Make sure you are monitoring a mount point and not a device (like /dev/sdb1) Share. For example: check filesystem NTFSDisk with path /mnt/ntfsdisk. | summarize FreeSpace = min(FreeSpaceGB) by Computer, InstanceName Sorry your configuration is incomplete, it is lacking the check and mount point. | extend FreeSpaceGB = CounterValue/1024 // converting the counter value to GB | where InstanceName != "HarddiskVolume1" exclude all others as we are checking for C: here | where ObjectName = "LogicalDisk" and CounterName = "Free Megabytes" Step 6: Fill rest details like email subject and severity of the alert you want to set it to and then create alert.Ĭustom Query: let setgbvalue = 200 //Set the disk space you want to check for. There exists four major steps to check disk space on SQL server. After its Created click on the action group and add the notification type as Email or anything you want to specify. ![]() Step 5: Now Select an existing Action group that you have or you can create a new one by clicking on create new and filling the details. Step 4: Then provide the Custom Query which I have provided below in the search query box and you can set the threshold value to “0” and period and frequency in mins as per your requirement for an example I have set it to 60mins. Step 3: Now select the Custom Log Search. ![]() Step 2: Then select the resource and by resource here you have to select the Log analytics workspace which you have enabled the VM monitoring for. Step 1 : Go to Alerts on your Monitor Page and click on New alert rule. Optionally delete recordings to stay above a specified free space minimum, get rid of recordings older than a maximum age, or keep only a certain number of episodes. Monitor disk space utilization of HDHomeRun SCRIBE, SERVIO, and RECORD devices. But you can create a new alert with custom log search to get the details and then trigger the email to you. pip install hdhr-disk-space-monitorCopy PIP instructions. There are no predefined alerts for diskspace as of now.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |