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 , open the file /modules/servers/dedicated/system/OnlineOfflineStrings.php and add the correct strings into the file.

...

by the module, you can extend the default strings. 

Please note the following things:

...

  • All values must be lowercase

...

The default file looks like this:

Code Block
languagephp
titleOnlineOfflineStrings.php
linenumberstrue
$OnlineStringArray = array('chassis power is on', 'on', 'online', 'running');
$OfflineStringArray = array('chassis power is off', 'off', 'offline', 'stopped');
$ConnectionError = array('unable to establish');
  • , 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".

To extend the power strings, follow this 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.

Example

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
;

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