@AngeleToR Thanks for the update and testing.
Well actually there is provision already in place for the timed shutdown by way of a remarked out schedule. NUT can have it’s own scheduler enabled and Rockstor’s implementation does just this. However there is no provision as of yet to modify the default schedules established by Rockstor via the Web-UI. But given the NUT scheduler file used by Rockstor is derived (actually it’s currently just copied as in) from /opt/rockstor/conf/upssched.conf; if you make changes to that file they will in turn be activated in the next NUT/UPS config submit via the Web-UI.
We have a few ‘technical manuals’ for various Rockstor subsystems within this forum under the Wiki section which are intended primarily for developers and advanced users and luckily NUT has one. From this we have:
The remarked out shutdown schedule I mentioned above is in /opt/rockstor/conf/upssched.conf and is instantiated by the last 2 lines of the file with the 3rd from last being a comment to explain the same:
# remark out these 2 lines to shutdown after # seconds on battery
#AT ONBATT * START-TIMER early-shutdown 120
#AT ONLINE * CANCEL-TIMER early-shutdown
currently this is at the very end of that file but that may change in the future of course.
So if you wanted to go with the rather short time frame of 2 minutes (120 seconds), good for testing and smaller battery units, you could just uncomment those 2 lines and re-submit your NUT/UPS config via the Web-UI. The effect is to simply use the scheduler to activate a pre-defined behaviour and email notification established in it’s sister file /opt/rockstor/conf/upssched-cmd which should not require alteration.
There are a few other concerns / considerations / complexities with this method such as what state the UPS itself is left in (likely the same actually) but those are beyond this post really and are no different from the current behaviour.
In open source we are given the tools to effectively ‘shoot our selves in the foot’ so obviously do take care when changing any of these files.
Hope that helps and let us know how you get on.