Search in sources :

Example 6 with AuditLogableBase

use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase in project ovirt-engine by oVirt.

the class VmAnalyzer method auditVmPowerDownFailed.

private void auditVmPowerDownFailed() {
    AuditLogableBase logable = Injector.injectMembers(new AuditLogableBase(vdsManager.getVdsId(), dbVm.getId()));
    auditLog(logable, AuditLogType.VM_POWER_DOWN_FAILED);
}
Also used : AuditLogableBase(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase)

Example 7 with AuditLogableBase

use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase in project ovirt-engine by oVirt.

the class VmAnalyzer method proceedGuaranteedMemoryCheck.

private void proceedGuaranteedMemoryCheck() {
    VmBalloonInfo vmBalloonInfo = vdsmVm.getVmBalloonInfo();
    if (vmBalloonInfo != null && vmBalloonInfo.getCurrentMemory() != null && vmBalloonInfo.getCurrentMemory() > 0 && getVmManager().getMinAllocatedMem() > vmBalloonInfo.getCurrentMemory() / TO_MEGA_BYTES) {
        AuditLogableBase auditLogable = Injector.injectMembers(new AuditLogableBase());
        auditLogable.addCustomValue("VmName", getVmManager().getName());
        auditLogable.addCustomValue("VdsName", vdsManager.getVdsName());
        auditLogable.addCustomValue("MemGuaranteed", String.valueOf(getVmManager().getMinAllocatedMem()));
        auditLogable.addCustomValue("MemActual", Long.toString(vmBalloonInfo.getCurrentMemory() / TO_MEGA_BYTES));
        auditLog(auditLogable, AuditLogType.VM_MEMORY_UNDER_GUARANTEED_VALUE);
    }
}
Also used : AuditLogableBase(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase) VmBalloonInfo(org.ovirt.engine.core.common.businessentities.VmBalloonInfo)

Example 8 with AuditLogableBase

use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase in project ovirt-engine by oVirt.

the class VmAnalyzer method auditVmSuspended.

private void auditVmSuspended() {
    VmDynamic vm = vdsmVm.getVmDynamic();
    AuditLogType type = vm.getExitStatus() == VmExitStatus.Normal ? AuditLogType.USER_SUSPEND_VM_OK : AuditLogType.USER_FAILED_SUSPEND_VM;
    AuditLogableBase logable = Injector.injectMembers(new AuditLogableBase(vdsManager.getVdsId(), vm.getId()));
    auditLog(logable, type);
}
Also used : AuditLogableBase(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase) AuditLogType(org.ovirt.engine.core.common.AuditLogType) VmDynamic(org.ovirt.engine.core.common.businessentities.VmDynamic)

Example 9 with AuditLogableBase

use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase in project ovirt-engine by oVirt.

the class VmAnalyzer method auditClientIpChange.

public void auditClientIpChange() {
    final AuditLogableBase event = Injector.injectMembers(new AuditLogableBase());
    event.setVmId(dbVm.getId());
    event.setUserName(dbVm.getConsoleCurrentUserName());
    String clientIp = vdsmVm.getVmDynamic().getClientIp();
    auditLogDirector.log(event, clientIp == null || clientIp.isEmpty() ? AuditLogType.VM_CONSOLE_DISCONNECTED : AuditLogType.VM_CONSOLE_CONNECTED);
}
Also used : AuditLogableBase(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase)

Example 10 with AuditLogableBase

use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase in project ovirt-engine by oVirt.

the class VmAnalyzer method auditVmRestoredFromUnknown.

private void auditVmRestoredFromUnknown() {
    final AuditLogableBase auditLogable = Injector.injectMembers(new AuditLogableBase());
    auditLogable.setVmId(dbVm.getId());
    auditLogable.addCustomValue("VmStatus", vdsmVm.getVmDynamic().getStatus().toString());
    auditLog(auditLogable, AuditLogType.VM_STATUS_RESTORED);
}
Also used : AuditLogableBase(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase)

Aggregations

AuditLogableBase (org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase)22 AuditLogType (org.ovirt.engine.core.common.AuditLogType)3 VmDynamic (org.ovirt.engine.core.common.businessentities.VmDynamic)2 Guid (org.ovirt.engine.core.compat.Guid)2 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 Before (org.junit.Before)1 ProcessDownVmParameters (org.ovirt.engine.core.common.action.ProcessDownVmParameters)1 AuditLog (org.ovirt.engine.core.common.businessentities.AuditLog)1 StorageDomain (org.ovirt.engine.core.common.businessentities.StorageDomain)1 StoragePool (org.ovirt.engine.core.common.businessentities.StoragePool)1 VDS (org.ovirt.engine.core.common.businessentities.VDS)1 VM (org.ovirt.engine.core.common.businessentities.VM)1 VmBalloonInfo (org.ovirt.engine.core.common.businessentities.VmBalloonInfo)1 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)1 Pair (org.ovirt.engine.core.common.utils.Pair)1 SetVmStatusVDSCommandParameters (org.ovirt.engine.core.common.vdscommands.SetVmStatusVDSCommandParameters)1 VDSReturnValue (org.ovirt.engine.core.common.vdscommands.VDSReturnValue)1 AuditLogDirector (org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector)1