centreon / centreon-documentation

Centreon documentation
https://docs.centreon.com
Other
19 stars 108 forks source link

Deep understand the parameter --filter #3165

Closed DarkKnight9292 closed 6 months ago

DarkKnight9292 commented 7 months ago

I'm confuse every time i have use the paramter --filter on Centreon

My situation that example i have this output:

Checking nic Adapter HPE Ethernet 1Gb 4-port 369i Adapter - 'Port 3' status is 'Link Down' Adapter HPE Ethernet 1Gb 4-port 369i Adapter - 'Port 2' status is 'Unknown' Adapter HPE Ethernet 1Gb 4-port 369i Adapter - 'Port 1' status is 'OK' Adapter HP Ethernet 1Gb 2-port 332T Adapter - 'Port 1' status is 'Unknown' Adapter HP Ethernet 1Gb 2-port 332T Adapter - 'Port 2' status is 'OK'

Because only 2 of 5 nic has been use so i want to skip check on another 3 port (1 link Down and 2 Unknow) , example i try to use --filter "Adapternic,HPE Ethernet 1Gb 4-port 369i Adapter - Port 2' and it working but i don't understanding how it work ? so i want to know how it working and i can use the parameter in the future .

P/S: i have search but can't found how --filter working, not sure if --filter will working same method on all plugin or it will working diffrent for each plugin.

Thank you

Additional context Add any other context or screenshots about the feature request here.

cg-tw commented 7 months ago

Hello @DarkKnight9292 Can you tell us which connector you are using?

DarkKnight9292 commented 7 months ago

Hello @cg-tw , i'm using /usr/lib/centreon/plugins/centreon_hp_ilo_xmlapi_custom.pl --plugin=hardware::server::hp::ilo::xmlapi::plugin -mode=hardware Thank you.

cg-tw commented 7 months ago

The description for the --filter parameter is in this table: https://docs.centreon.com/pp/integrations/plugin-packs/procedures/hardware-servers-hp-ilo-xmlapi/#available-options Is it ok for you or do you need more information?

DarkKnight9292 commented 7 months ago

Thank for your help. But yes i need more information, i want to know how filter working ? it will filter the output or the result of the xml (with --debug), example: Here the output on Centreon: Checking nic Adapter HPE Ethernet 1Gb 4-port 369i Adapter - 'Port 3' status is 'Link Down' Adapter HPE Ethernet 1Gb 4-port 369i Adapter - 'Port 2' status is 'Unknown' Adapter HPE Ethernet 1Gb 4-port 369i Adapter - 'Port 1' status is 'OK' Adapter HP Ethernet 1Gb 2-port 332T Adapter - 'Port 1' status is 'Unknown' Adapter HP Ethernet 1Gb 2-port 332T Adapter - 'Port 2' status is 'OK'

if i use --filter='Adapternic,HPE Ethernet 1Gb 4-port 369i Adapter - Port 2' -> the port 2 of adapter 369i will be skip as we expectec.

but in my opinion when i'm using --filter='HPE Ethernet 1Gb 4-port 369i Adapter - Port 2' or '--filter='nic,HPE Ethernet 1Gb 4-port 369i Adapter - Port 2' it not working ? Thank you

cg-tw commented 7 months ago

@DarkKnight9292 We are looking into the matter and we will be in touch as soon as we can.

omercier commented 7 months ago

Hi @DarkKnight9292, You can speak French if you prefer. Can you run the plugin with the --debug option, we have too few data to analyze the problem.

DarkKnight9292 commented 7 months ago

Hi omercier, Actually this is not a prolems, i just want to understand how it working . here the debug output

Checking nic Adapter HPE Ethernet 1Gb 4-port 369i Adapter - 'Port 3' status is 'Link Down' Adapter HPE Ethernet 1Gb 4-port 369i Adapter - 'Port 2' status is 'Unknown' Adapter HPE Ethernet 1Gb 4-port 369i Adapter - 'Port 4' status is 'Unknown' Adapter HPE Ethernet 1Gb 4-port 369i Adapter - 'Port 1' status is 'OK' Adapter HP Ethernet 1Gb 2-port 332T Adapter - 'Port 1' status is 'Unknown' Adapter HP Ethernet 1Gb 2-port 332T Adapter - 'Port 2' status is 'OK'

ponchoh commented 6 months ago

@DarkKnight9292 might be of interest:

https://github.com/centreon/centreon-plugins/blob/develop/src/hardware/server/hp/ilo/xmlapi/mode/hardware.pm#L90-L97

Exclude the given items (example: --filter=temperature --filter=fan).
You can also exclude items from specific instances: --filter="fan,Fan Block 1"

only see these

'fan', 'temperature', 'vrm', 'psu', 'cpu', 'memory', 'nic', 'battery', 'ctrl',
        'driveencl', 'pdrive', 'ldrive', 'bios'

https://github.com/centreon/centreon-plugins/blob/develop/src/hardware/server/hp/ilo/xmlapi/mode/hardware.pm#L57-L58

DarkKnight9292 commented 6 months ago

Thank @ponchoh , Yes i saw this but in my case it not help much.

ponchoh commented 6 months ago

@DarkKnight9292 so the, fitler is to exclude. You can choose from:

'fan', 'temperature', 'vrm', 'psu', 'cpu', 'memory', 'nic', 'battery', 'ctrl','driveencl', 'pdrive', 'ldrive', 'bios'

& then if you want from "specific instances" after the ",". Was there something more specific. I can recommend to head over to https://thewatch.centreon.com/ for more help. I think we can close this.

cg-tw commented 6 months ago

I'm closing this as it is a question rather than an issue with the documentation.