use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl in project ovirt-engine by oVirt.
the class UpdateVmCommand method logHotSetActionEvent.
/**
* add audit log msg for failed hot set in case error was in CDA
* otherwise internal command will audit log the result
*/
private void logHotSetActionEvent(ActionReturnValue setActionResult, AuditLogType logType) {
if (!setActionResult.isValid()) {
AuditLogable logable = new AuditLogableImpl();
logable.setVmId(getVmId());
logable.setVmName(getVmName());
List<String> validationMessages = backend.getErrorsTranslator().translateErrorText(setActionResult.getValidationMessages());
logable.addCustomValue(HotSetNumberOfCpusCommand.LOGABLE_FIELD_ERROR_MESSAGE, StringUtils.join(validationMessages, ","));
auditLogDirector.log(logable, logType);
}
}
use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl in project ovirt-engine by oVirt.
the class FenceAgentExecutor method createAuditLogObject.
private AuditLogable createAuditLogObject(FenceActionType action, FenceAgent agent, VDS proxyHost) {
AuditLogable alb = new AuditLogableImpl();
alb.addCustomValue("Action", action.name().toLowerCase());
alb.addCustomValue("Host", fencedHost.getName() == null ? fencedHost.getId().toString() : fencedHost.getName());
alb.addCustomValue("AgentType", agent.getType());
alb.addCustomValue("AgentIp", agent.getIp());
alb.addCustomValue("ProxyHost", proxyHost.getName());
alb.setVdsId(fencedHost.getId());
return alb;
}
use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl in project ovirt-engine by oVirt.
the class MacPoolUsingRanges method initialize.
void initialize(boolean engineStartup, List<String> macsForMacPool) {
log.info("Initializing {}", this);
this.macsStorage = createMacsStorage(this.rangesBoundaries);
log.debug("Initializing {} with macs: {}", this, macsForMacPool);
List<String> notAddedMacs = addMacs(macsForMacPool);
if (!notAddedMacs.isEmpty()) {
if (engineStartup) {
String auditLogMessage = "Following MACs violates duplicity restriction, and was pushed into MAC pool without respect to it:" + notAddedMacs;
auditLogDirector.log(new AuditLogableImpl(), AuditLogType.MAC_ADDRESS_VIOLATES_NO_DUPLICATES_SETTING, auditLogMessage);
forceAddMacs(notAddedMacs);
} else {
throw new EngineException(EngineError.MAC_POOL_INITIALIZATION_FAILED, "Unable to initialize MAC pool due to existing duplicates");
}
}
log.info("Finished initializing {}. Available MACs in pool: {}", this, macsStorage.getAvailableMacsCount());
}
use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl in project ovirt-engine by oVirt.
the class PowerSavingBalancePolicyUnit method logAction.
private void logAction(VDS vds, AuditLogType type) {
AuditLogable loggable = new AuditLogableImpl();
loggable.addCustomValue("Host", vds.getName());
loggable.setVdsName(vds.getName());
loggable.setVdsId(vds.getId());
loggable.setClusterId(vds.getClusterId());
loggable.setClusterName(vds.getClusterName());
Injector.get(AuditLogDirector.class).log(loggable, type);
}
use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl in project ovirt-engine by oVirt.
the class DataCenterCompatibilityChecker method logAlert.
private void logAlert(Version version, StoragePool storagePool) {
AuditLogable auditLog = new AuditLogableImpl();
auditLog.setStoragePoolId(storagePool.getId());
auditLog.setStoragePoolName(storagePool.getName());
auditLog.addCustomValue("engineVersion", version.toString());
auditLog.addCustomValue("dcVersion", storagePool.getCompatibilityVersion().toString());
auditLogDirector.log(auditLog, AuditLogType.STORAGE_POOL_LOWER_THAN_ENGINE_HIGHEST_CLUSTER_LEVEL);
}
Aggregations