The power status of the server is detected on the string which is returned by the NOC-PS API. Depending on the device, the returned string can differ. If the power status of your server does not get detected correctly by the module, you can extend the default values.
Please note the following things:
- All values must be lowercase, even if NOC-PS returns the value capitalized or uppercase.
- You should not directly edit the "OnlineOfflineStrings.php" file. This file will get overwritten on module upgrades.
- To view the default power values, please open the file "/modules/servers/dedicated/system/OnlineOfflineString.php".
Add new power status values to the module
To extend the power values, follow this simple steps:
- Get the required value by opening the NOC-PS admin panel and click on IPMI → Status → Execute Command.
- A popup will appear with a message like "serverUP".
- Create or open the file "/modules/servers/dedicated/system/OnlineOfflineStrings.override.php" and add the value to the array found in the file OnlineOfflineString.php.
By making the changes in the override file, they are not reverted during a module update.
Exemplary Modification
If NOC-PS returns "serverUp" for online and "serverDown" for offline, insert the following value into the OnlineOfflineStrings.override.php file:
Edited file
<?php $OnlineStringArray[] = 'serverup'; $OfflineStringArray[] = 'serverdown';
As already mentioned, you must insert the value in lowercase.