Go to All Forums

Monitor unmounted volumes

Is there a way to alert for volumes that are present on a Linux instance, but not used? As in: not mounted anywhere?

Like (2) Reply
Replies (6)

Hi Tom,

Currently, we do not have the support to alert when an unmounted volume is present in the server.

However, execute the following commands in the server where you have unmounted volumes:

blkid -o list  

lsblk --noheadings --raw -o NAME,MOUNTPOINT | awk '$1~/[[:digit:]]/ && $2 == ""'

If the above commands provide the desired output, we can implement a custom plugin for the same.

 

Regards,

Sriram

Like (0) Reply

Hi Sriram,

 

Not exactly:

It also lists the first disk on which a partition is created. The disk itself is not mounted of course, but the partition is.

Like (0) Reply

Hi Tom ,

Thanks for sharing the output. Here again, two cases are possible:

Case 1: There are two disks available nvme0n1 and nvme1n1 in which the first disk is connected and partitioned with nvme0n1p1. Do you need an alert for nvme1n1 not partitioned?

Case 2: A new partition, say nvme1np1 is created in the disk nvme1n1 and its not mounted. Do you need an alert for this ?

From the output, case 1 looks more plausible. Please explain the above two cases so that we can narrow down the use case.

 

Regards,

Sriram

Like (0) Reply

In all fairness, it might need to be both: a disk with no partitions, that is not mounted anywhere :)

Like (0) Reply

Hi Tom,

Please follow the steps below to detect and monitor the unmounted disk and its partition:

  1. Download the plugin script from our GitHub repository.
  2. Execute the plugin using the below command and confirm if the desired output is obtained:
    python check_partitions.py
  3. Create a folder check_partitions and place the plugin file check_partitions.py inside it. Then, move the plugin folder check_partitions to the Linux server monitoring agent plugins directory: /opt/site24x7/monagent/plugins

In the next data collection, the agent will automatically execute the plugin within five minutes and send the performance data to the Site24x7 data center.

By default, the plugin will provide the status as 1. If any partition is not mounted, it will give the output status as 0 and mark the monitor as Down with the corresponding Down message in the Site24x7 web client.

Hope this helps. Let us know for further queries, if any, in the below thread.  

 

Regards,

Sriram

Like (0) Reply


Was this post helpful?