Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The power status of the server is detected on the string which returns 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

...

Info
titleAdded values must be lowercase

All values must be lowercase. Even if the returned value is capitalized.

The default file looks like this:

...

languagephp
titleOnlineOfflineStrings.php
linenumberstrue
  • ".

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, edit the file accordingly. Note that the value has to be inserted lowercaseinsert the following value into the OnlineOfflineStrings.override.php file:

Code Block
languagephp
titleEdited file
linenumberstrue
<?php

$OnlineStringArray[] = array('chassis power is on', 'on', 'online', 'running', 'serverup');
$OfflineStringArray[] = array('chassis power is off', 'off', 'offline', 'stopped', 'serverdown');
$ConnectionError = array('unable to establish');

The correct values can be checked at the NOC-PS admin panel:

  1. Open the NOC-PS admin page
  2. Select the server and click on IPMI
  3. Click on status → Execute command

Image RemovedAs already mentioned, you must insert the value in lowercase.