Imported Upstream version 2.6.3
This commit is contained in:
parent
45043b58d0
commit
fad6ced6f6
255 changed files with 11081 additions and 4629 deletions
|
|
@ -21,11 +21,27 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
TODO:
|
||||
* add power control support (ipmipower): seems OOB only!
|
||||
-n, --on Power on the target hosts.
|
||||
-f, --off Power off the target hosts.
|
||||
-c, --cycle Power cycle the target hosts.
|
||||
-r, --reset Reset the target hosts.
|
||||
-s, --stat Get power status of the target hosts.
|
||||
--pulse Send power diagnostic interrupt to target hosts.
|
||||
--soft Initiate a soft-shutdown of the OS via ACPI.
|
||||
--on-if-off Issue a power on command instead of a power cycle
|
||||
or hard reset command if the remote machine's
|
||||
power is currently off.
|
||||
--wait-until-off Regularly query the remote BMC and return only
|
||||
after the machine has powered off.
|
||||
--wait-until-on Regularly query the remote BMC and return only
|
||||
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include "timehead.h"
|
||||
#include <freeipmi/freeipmi.h>
|
||||
#include <ipmi_monitoring.h>
|
||||
#include <ipmi_monitoring_bitmasks.h>
|
||||
|
|
@ -711,6 +727,7 @@ int nut_ipmi_monitoring_init()
|
|||
return -1;
|
||||
}
|
||||
|
||||
#if HAVE_FREEIPMI_MONITORING
|
||||
/* FIXME: replace "/tmp" by a proper place, using mkdtemp() or similar */
|
||||
if (ipmi_monitoring_ctx_sdr_cache_directory (mon_ctx, "/tmp") < 0) {
|
||||
upsdebugx (1, "ipmi_monitoring_ctx_sdr_cache_directory() error: %s",
|
||||
|
|
@ -723,16 +740,20 @@ int nut_ipmi_monitoring_init()
|
|||
ipmi_monitoring_ctx_errormsg (mon_ctx));
|
||||
return -1;
|
||||
}
|
||||
#endif /* HAVE_FREEIPMI_MONITORING */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nut_ipmi_get_sensors_status(IPMIDevice_t *ipmi_dev)
|
||||
{
|
||||
int retval = -1;
|
||||
|
||||
#if HAVE_FREEIPMI_MONITORING
|
||||
/* It seems we don't need more! */
|
||||
unsigned int sensor_reading_flags = IPMI_MONITORING_SENSOR_READING_FLAGS_IGNORE_NON_INTERPRETABLE_SENSORS;
|
||||
int sensor_count, i, str_count;
|
||||
int psu_status = PSU_STATUS_UNKNOWN;
|
||||
int retval = 0;
|
||||
|
||||
if (mon_ctx == NULL) {
|
||||
upsdebugx (1, "Monitoring context not initialized!");
|
||||
|
|
@ -930,6 +951,7 @@ int nut_ipmi_get_sensors_status(IPMIDevice_t *ipmi_dev)
|
|||
|
||||
status_commit();
|
||||
}
|
||||
#endif /* HAVE_FREEIPMI_MONITORING */
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue