Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ctor 716 plugin network cisco standar #5455

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

sfarouq-ext
Copy link
Contributor

@sfarouq-ext sfarouq-ext commented Feb 19, 2025

REFS CTOR-716

Checklist

  • I have followed the coding style guidelines provided by Centreon
  • I have commented my code, especially hard-to-understand areas of the PR.
  • I have rebased my development branch on the base branch (develop).
  • In case of a new plugin, I have created the new packaging directory accordingly.
  • I have implemented automated tests related to my commits.
    • Data used for automated tests are anonymized.
  • I have reviewed all the help messages in all the .pm files I have modified.
    • All sentences begin with a capital letter.
    • All sentences end with a period.
    • I am able to understand all the help messages, if not, exchange with the PO or TW to rewrite them.
  • After having created the PR, I will make sure that all the tests provided in this PR have run and passed.


Examples: tc extra_options expected_result --
... 1 --verbose OK: All 0 components are ok []. Environment type: c37xx Checking fans Checking power supplies Checking temperatures Checking voltages Checking modules Checking physicals Checking sensors
... 2 --threshold-overload='fan,CRITICAL,^(?!(up|normal)$)' OK: All 0 components are ok [].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you don't have any data for this mode don't test it, you can delete the file.
If you have the data can you put them in the snmpwalk so there is more than 0 component checked by the plugin ?

Ctn Run Command And Check Result As Strings ${command} ${expected_result}

Examples: tc extra_options expected_result --
... 1 --warning-core-load-1m --critical-core-load-1m OK:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this empty ?
the plugin should send back data.
Seem like the oid used by the plugin are .1.3.6.1.4.1.9.9.109.1.1.1.1.24
.1.3.6.1.4.1.9.9.109.1.1.1.1.25
.1.3.6.1.4.1.9.9.109.1.1.1.1.26
and it's not present in you snmpwalk, maybe it's in another snmpwalk ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is empty because 'OK: => Anormal il faudrait y jeter un oeil au passage (pour l'équipe de dev Connectors en perl)
En --debug ça donne
OK:
.1.3.6.1.4.1.9.9.109.1.1.1.1.2.1 = 1001' That's what’s written in the ticket.

Ctn Run Command And Check Result As Strings ${command} ${expected_result}

Examples: tc extra_options expected_result --
... 1 --warning-usage OK: All memories are ok | 'used_Anonymized 021'=81605080B;;;0;366174644 'used_Anonymized 062'=40B;;;0;938040 'used_Anonymized 021'=40B;;;0;85960 'used_Anonymized 246'=12689640B;;;0;33554432 'used_Anonymized 135'=40B;;;0;1048576
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filter-pool warning-usage critical-usage expect arguments
I think the --verbose mode is not usefull to test because it's an internal mode to debug the plugin

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


Examples: tc extra_options expected_result --
... 1 ${EMPTY} OK: All memory flash partitions are ok | 'Anonymized 175#memory.flash.usage.bytes'=68809216B;;;0;122185728 'Anonymized 175#memory.flash.free.bytes'=53376512B;;;0;122185728 'Anonymized 175#memory.flash.usage.percentage'=56.32%;;;0;100 'Anonymized 163#memory.flash.usage.bytes'=68844544B;;;0;122185728 'Anonymized 163#memory.flash.free.bytes'=53341184B;;;0;122185728 'Anonymized 163#memory.flash.usage.percentage'=56.34%;;;0;100 'Anonymized 131#memory.flash.usage.bytes'=65309184B;;;0;122185728 'Anonymized 131#memory.flash.free.bytes'=56876544B;;;0;122185728 'Anonymized 131#memory.flash.usage.percentage'=53.45%;;;0;100
... 2 --warning-status='\\\%{status}' WARNING: Partition 'Anonymized 175' status : readWrite - Partition 'Anonymized 163' status : readWrite - Partition 'Anonymized 131' status : readWrite | 'Anonymized 175#memory.flash.usage.bytes'=68809216B;;;0;122185728 'Anonymized 175#memory.flash.free.bytes'=53376512B;;;0;122185728 'Anonymized 175#memory.flash.usage.percentage'=56.32%;;;0;100 'Anonymized 163#memory.flash.usage.bytes'=68844544B;;;0;122185728 'Anonymized 163#memory.flash.free.bytes'=53341184B;;;0;122185728 'Anonymized 163#memory.flash.usage.percentage'=56.34%;;;0;100 'Anonymized 131#memory.flash.usage.bytes'=65309184B;;;0;122185728 'Anonymized 131#memory.flash.free.bytes'=56876544B;;;0;122185728 'Anonymized 131#memory.flash.usage.percentage'=53.45%;;;0;100
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This parameter expect something like --warning-status='\%{status} eq "readwrite"'
Because it check the truthiness of the parameter after changing the macro. what you put mean you check if the status variable is "true"
In perl 0, empty string "" and undef is false, the rest is considered true.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use a filter to reduce the size of the output pls ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

... 5 --force-oid='.1.3.6.1.2.1.2.2.1.3.181' OK: System uptime is: 0d | 'uptime'=0.00s;;;0;
... 6 --check-overload --reboot-window=1000 OK: System uptime is: 19d 16h 25m 40s | 'uptime'=1700740.00s;;;0;
... 7 --unit='w' OK: System uptime is: 19d 16h 25m 40s | 'uptime'=2.81w;;;0;
... 8 --unit='y' OK: System uptime is: 19d 16h 25m 40s | 'uptime'=1700740.00s;;;0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

year is not implemented in this mode
And this is a snmp_standard mode, it should be tested with the other snmp standard mode, not here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants