1

A particular Object Store, in my FileNet environement, is using a NAS as a Storage Area (this is a typical configuration). By the way, I do not have access to that NAS (the team that maintains the storage is remotely distant from me) and I want to know - in a particular moment - the available space. If the NAS will be almost saturated, I wish to know it in time, in order to make a request for adding free space on it.

If I inspect the Storage Area's properties from FEM, I obtain this:

enter image description here

As you can see, it shows no free bytes, but it is not true. It is, by the way, precise in the order of file count.

I also accessed the section "Storage Areas" of http://server:port/P8CE/Health, but it just shows the status of them:

enter image description here

Is there a way to know the available space of a Storage Area, via FEM or APIs?

Andrea
  • 6,032
  • 2
  • 28
  • 55
  • After browsing through the JavaDoc for the API, I would say no. But if you know the initial size (which the NAS guys should be able to give you) you can do the maths using https://www.ibm.com/support/knowledgecenter/en/SSGLW6_5.2.1/com.ibm.p8.ce.dev.java.doc/com/filenet/api/admin/StorageArea.html#get_ContentElementKBytes(). – Tekcins Mar 19 '19 at 19:53

1 Answers1

2

You can not get the size or free space of the underlying storage device in FileNet. But you can do either of the following two

Set "Maximum size" parameter of the Storage area

Set the "Maximum size" parameter of the Storage Area to the allocated/maximum available space on the NAS.

After having done, you can check and calculate the available free space using the API. To get the values, something along the line of the following code snippet should do the trick

StorageAreaSet storageAreaSet = filenetConnection.getObjectStore().get_StorageAreas();

  Iterator<StorageArea> iter = storageAreaSet.iterator();
  while(iter.hasNext()){

    StorageArea sa = iter.next();
    System.out.printf("Storage Area %s is %s uses %f KB of %f KB available\n", sa.get_DisplayName(), sa.get_ResourceStatus().toString(), sa.get_ContentElementKBytes(), sa.get_MaximumSizeKBytes());

  }

Use a monitoring software

What we usually do is, monitor the free space of our storage devices using our monitoring solution. The monitoring solution sends an alarm if the available storage drops below a certain percentage

Tekcins
  • 134
  • 8
  • Thank you for your snippet, it's very helpful. Just a thing: when you say "allocated/maximum available space on the NAS", I suspect that I have to contact the sysadmin guys in order to know it. There should be no way to retrieve that from APIs or FEM. Because, now, I have, as "Maximum size", "Maximum allowed on device" selected, so that I can do no calculations. – Andrea Mar 20 '19 at 10:57
  • Yes, your suspicion concerning the NAS space is correct. You would have to contact the sysadmins responsible for the storage. On a second thought (I have not tried it), it may be worth to look at the [java.io.File.getUsableSpace() Method](https://docs.oracle.com/javase/6/docs/api/java/io/File.html#getUsableSpace()) – Tekcins Mar 20 '19 at 12:01
  • The "Maximum allowed on device" is only useful if it is set on the Storage Area. Here also you would have to get in touch with the sysadmins to get the value. See [JavaDoc for the StorageArea class]()https://www.ibm.com/support/knowledgecenter/en/SSGLW6_5.2.1/com.ibm.p8.ce.dev.java.doc/com/filenet/api/admin/StorageArea.html – Tekcins Mar 20 '19 at 12:12
  • Thank you so much for now, I'm going to put some test in place starting from your input and I will let you know. – Andrea Mar 20 '19 at 12:47