Merge branch 'develop' of https://github.com/centreon/centreon-plugins into CTOR-795-automated-test-os-snmp

This commit is contained in:
sfarouq-ext 2024-09-03 18:04:00 +02:00
commit e9e1eb099e
16 changed files with 1135 additions and 28 deletions

View File

@ -48,22 +48,22 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Login to Registry
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}
username: ${{ secrets.DOCKER_REGISTRY_ID }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
- name: Login to proxy registry
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ${{ vars.DOCKER_PROXY_REGISTRY_URL }}
username: ${{ secrets.DOCKER_REGISTRY_ID }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
- uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
- uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1
- uses: docker/build-push-action@15560696de535e4014efeff63c48f16952e52dd1 # v6.2.0
- uses: docker/build-push-action@5176d81f87c23d6fc96624dfdbcd9f3830bbe445 # v6.5.0
with:
file: .github/docker/packaging/Dockerfile.${{ matrix.dockerfile }}
context: .

View File

@ -48,22 +48,22 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Login to Registry
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}
username: ${{ secrets.DOCKER_REGISTRY_ID }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
- name: Login to proxy registry
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ${{ vars.DOCKER_PROXY_REGISTRY_URL }}
username: ${{ secrets.DOCKER_REGISTRY_ID }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
- uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
- uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1
- uses: docker/build-push-action@15560696de535e4014efeff63c48f16952e52dd1 # v6.2.0
- uses: docker/build-push-action@5176d81f87c23d6fc96624dfdbcd9f3830bbe445 # v6.5.0
with:
file: .github/docker/testing/Dockerfile.testing-plugins-${{ matrix.dockerfile }}
context: .

View File

@ -233,7 +233,7 @@ jobs:
shell: bash
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }}
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: packages-${{ matrix.package_extension }}-${{ matrix.distrib }}-${{ steps.package-name.outputs.name_with_dash }}
path: ./*.${{ matrix.package_extension }}
@ -278,7 +278,7 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: packages-rpm-${{ matrix.distrib }}
path: ./
@ -463,7 +463,7 @@ jobs:
shell: bash
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }}
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: packages-${{ matrix.package_extension }}-${{ matrix.distrib }}-${{ matrix.arch }}-${{ steps.package-name.outputs.name_with_dash}}
path: ./*.${{ matrix.package_extension }}
@ -494,7 +494,7 @@ jobs:
matrix:
distrib: [bullseye, bookworm, jammy]
steps:
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: packages-deb-${{ matrix.distrib }}
path: ./

View File

@ -135,7 +135,7 @@ jobs:
# set condition to true if artifacts are needed
- if: ${{ false }}
name: Upload package artifacts
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: packages-${{ matrix.distrib }}-${{ matrix.arch }}
path: ./*.${{ matrix.package_extension}}

View File

@ -120,7 +120,7 @@ jobs:
# set condition to true if artifacts are needed
- if: ${{ false }}
name: Upload package artifacts
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: packages-${{ matrix.distrib }}
path: ./*.${{ matrix.package_extension}}

View File

@ -133,7 +133,7 @@ jobs:
# set condition to true if artifacts are needed
- if: ${{ false }}
name: Upload package artifacts
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: packages-${{ matrix.distrib }}-${{ matrix.arch }}
path: ./*.${{ matrix.package_extension}}

View File

@ -133,7 +133,7 @@ jobs:
# set condition to true if artifacts are needed
- if: ${{ false }}
name: Upload package artifacts
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: packages-${{ matrix.distrib }}-${{ matrix.arch }}
path: ./*.${{ matrix.package_extension }}

View File

@ -102,7 +102,7 @@ jobs:
path: ./*.rpm
key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
- uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: packages-${{ matrix.distrib }}
path: ./*.rpm

View File

@ -33,7 +33,7 @@ jobs:
with:
fetch-depth: 0
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
with:
python-version: '3.9'
@ -332,7 +332,7 @@ jobs:
- name: Upload apt/dnf logs as artifacts if tests failed
if: failure()
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: plugin-installation-${{ matrix.distrib }}
path: /var/log/robot-plugins-installation-tests.log

View File

@ -97,8 +97,7 @@ sub manage_selection {
pagination => {
limit => undef,
start => 0
},
reports => '/technology/management/snmp/communities'
}
};
my $snmp_community_api_results = $options{custom}->request_api(
@ -110,7 +109,7 @@ sub manage_selection {
for my $index (0 .. $#disco_data){
next if (!defined($disco_data[$index]->{hostname}));
if ($snmp_device->{hostname} eq $disco_data[$index]->{hostname}){
$disco_data[$index]->{snmp_community} = $snmp_device->{name}->{data};
$disco_data[$index]->{snmp_community} = $snmp_device->{name};
}
}
}

View File

@ -111,7 +111,7 @@ sub new {
'ps-display' => { name => 'ps_display' },
'filter-vm:s' => { name => 'filter_vm' },
'filter-note:s' => { name => 'filter_note' },
'filter-status:s' => { name => 'filter_status', default => 'running' }
'filter-status:s' => { name => 'filter_status', default => 'Running' }
});
return $self;
@ -218,17 +218,20 @@ sub manage_selection {
foreach my $node (@$decoded) {
if (defined($self->{option_results}->{filter_vm}) && $self->{option_results}->{filter_vm} ne '' &&
$node->{name} !~ /$self->{option_results}->{filter_vm}/i) {
$self->{output}->output_add(long_msg => "skipping '" . $node->{name} . "': no matching filter.", debug => 1);
$self->{output}->output_add(long_msg => "skipping '" . $node->{name} . "': no matching filter vm.", debug => 1);
next;
}
if (defined($self->{option_results}->{filter_status}) && $self->{option_results}->{filter_status} ne '' &&
$node_vm_state->{ $node->{state} } !~ /$self->{option_results}->{filter_status}/i) {
$self->{output}->output_add(long_msg => "skipping '" . $node->{name} . "': no matching filter.", debug => 1);
$self->{output}->output_add(long_msg => "skipping '" . $node->{name}
. "': node state " . $node->{state} . " (" . $node_vm_state->{ $node->{state} }
. ") does not match filter /" . $self->{option_results}->{filter_status}
. "/i", debug => 1);
next;
}
if (defined($self->{option_results}->{filter_note}) && $self->{option_results}->{filter_note} ne '' &&
defined($node->{note}) && $node->{note} !~ /$self->{option_results}->{filter_note}/i) {
$self->{output}->output_add(long_msg => "skipping '" . $node->{name} . "': no matching filter.", debug => 1);
$self->{output}->output_add(long_msg => "skipping '" . $node->{name} . "': no matching filter note.", debug => 1);
next;
}

View File

@ -0,0 +1,41 @@
*** Settings ***
Resource ${CURDIR}${/}..${/}..${/}resources/import.resource
Suite Setup Start Mockoon ${MOCKOON_JSON}
Suite Teardown Stop Mockoon
Test Timeout 120s
*** Variables ***
${MOCKOON_JSON} ${CURDIR}${/}ipfabric.mockoon.json
${CMD} ${CENTREON_PLUGINS} --plugin=apps::ipfabric::plugin
... --api-key=EEECGFCGFCGF
... --mode=discovery
... --http-peer-addr=127.0.0.1
... --proto=http
... --port=3000
... --prettify
*** Test Cases ***
Discovery ${tc}
[Tags] apps api ipfabric
${command} Catenate ${CMD}
... --hostname=${server_name}
${output} Run ${command} | wc -l
${output} Strip String ${output}
Should Be Equal As Strings
... ${output}
... ${expected_result}
... Wrong output result for command:\n${command}\n\nObtained:\n${output}\n\nExpected:\n${expected_result}\n
... values=False
... collapse_spaces=True
Examples: tc server_name expected_result --
... 1 cisco-live02.ipf.cx 5468
... 2 demo1.eu.ipfabric.io 99

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,767 @@
[
{
"note": "",
"integration_services_state": "",
"state": 3,
"name": "VSERVER01",
"services": [
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Guest Service Interface",
"enabled": false
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Heartbeat",
"enabled": true
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Key-Value Pair Exchange",
"enabled": true
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Shutdown",
"enabled": true
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "Time Synchronization",
"enabled": true
},
{
"primary_operational_status": null,
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 2,
"name": "VSERVER02",
"services": [
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Guest Service Interface",
"enabled": false
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Heartbeat",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Key-Value Pair Exchange",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Shutdown",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Time Synchronization",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 2,
"name": "VSERVER03",
"services": [
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Guest Service Interface",
"enabled": false
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Heartbeat",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Key-Value Pair Exchange",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Shutdown",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Time Synchronization",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 2,
"name": "VSERVER04",
"services": [
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Guest Service Interface",
"enabled": false
},
{
"primary_operational_status": "OK",
"secondary_operational_status": "OK",
"service": "Heartbeat",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Key-Value Pair Exchange",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Shutdown",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Time Synchronization",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 2,
"name": "VSERVER05",
"services": [
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Guest Service Interface",
"enabled": false
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Heartbeat",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Key-Value Pair Exchange",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Shutdown",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Time Synchronization",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 2,
"name": "VSERVER06",
"services": [
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Guest Service Interface",
"enabled": false
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Heartbeat",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Key-Value Pair Exchange",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Shutdown",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Time Synchronization",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 2,
"name": "VSERVER07",
"services": [
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Guest Service Interface",
"enabled": false
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Heartbeat",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Key-Value Pair Exchange",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Shutdown",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Time Synchronization",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 2,
"name": "VSERVER08",
"services": [
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Guest Service Interface",
"enabled": false
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Heartbeat",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Key-Value Pair Exchange",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Shutdown",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Time Synchronization",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 2,
"name": "VSERVER09",
"services": [
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Guest Service Interface",
"enabled": false
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Heartbeat",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Key-Value Pair Exchange",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Shutdown",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Time Synchronization",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 2,
"name": "VSERVER09",
"services": [
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Guest Service Interface",
"enabled": false
},
{
"primary_operational_status": "OK",
"secondary_operational_status": "OK",
"service": "Heartbeat",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Key-Value Pair Exchange",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Shutdown",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Time Synchronization",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 2,
"name": "VSERVER10",
"services": [
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Guest Service Interface",
"enabled": false
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Heartbeat",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Key-Value Pair Exchange",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Shutdown",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Time Synchronization",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 2,
"name": "VSERVER11",
"services": [
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Guest Service Interface",
"enabled": false
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Heartbeat",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Key-Value Pair Exchange",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Shutdown",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Time Synchronization",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 2,
"name": "VSERVER12",
"services": [
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Guest Service Interface",
"enabled": false
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Heartbeat",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Key-Value Pair Exchange",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Shutdown",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Time Synchronization",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 2,
"name": "VSERVER13",
"services": [
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Guest Service Interface",
"enabled": false
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Heartbeat",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Key-Value Pair Exchange",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Shutdown",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Time Synchronization",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 2,
"name": "VSERVER14",
"services": [
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Guest Service Interface",
"enabled": false
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Heartbeat",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Key-Value Pair Exchange",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Shutdown",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Time Synchronization",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 2,
"name": "VSERVER15",
"services": [
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Guest Service Interface",
"enabled": false
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Heartbeat",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Key-Value Pair Exchange",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Shutdown",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Time Synchronization",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
},
{
"note": "",
"integration_services_state": "",
"state": 2,
"name": "VSERVER16",
"services": [
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Guest Service Interface",
"enabled": false
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Heartbeat",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Key-Value Pair Exchange",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Shutdown",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "Time Synchronization",
"enabled": true
},
{
"primary_operational_status": "OK",
"secondary_operational_status": null,
"service": "VSS",
"enabled": true
}
],
"integration_services_version": "0.0"
}
]

View File

@ -13,19 +13,35 @@ ${CMD} ${CENTREON_PLUGINS}
... --command=cat
... --command-path=/usr/bin
... --no-ps
... --command-options=${CURDIR}/nodeintegrationservice-2022.json
*** Test Cases ***
HyperV 2022 ${tc}/3
HyperV 2022-1 ${tc}
[Documentation] Apps Microsoft HyperV 2022
[Tags] applications microsoft hyperv virtualization
${command} Catenate
... ${CMD}
... --command-options=${CURDIR}/nodeintegrationservice-2022-1.json
... --filter-vm='${filter_vm}'
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
Examples: tc filter_vm expected_result --
... 1 ${EMPTY} CRITICAL: 1 problem(s) detected
... 2 VSERVER05 OK: VM 'VSERVER05' 0 problem(s) detected - VM 'VSERVER05' 0 problem(s) detected
... 3 VSERVER07 CRITICAL: VM 'VSERVER07' 1 problem(s) detected
HyperV 2022-2 ${tc}
[Documentation] Apps Microsoft HyperV 2022
[Tags] applications microsoft hyperv virtualization
${command} Catenate
... ${CMD}
... --command-options=${CURDIR}/nodeintegrationservice-2022-2.json
... --filter-vm='${filter_vm}'
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
Examples: tc filter_vm expected_result --
... 1 ${EMPTY} OK: All integration services are ok
... 2 VSERVER05 OK: VM 'VSERVER05' 0 problem(s) detected - VM 'VSERVER05' 0 problem(s) detected
... 3 VSERVER07 OK: VM 'VSERVER07' 0 problem(s) detected - VM 'VSERVER07' 0 problem(s) detected