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

[network::cisco::meraki::cloudcontroller::restapi::plugin] - Cache not found #5057

Open
Thibaud-OBSSA opened this issue Jun 6, 2024 · 3 comments

Comments

@Thibaud-OBSSA
Copy link
Contributor

Thibaud-OBSSA commented Jun 6, 2024

When trying to use the plugin network::cisco::meraki::cloudcontroller::restapi::plugin ( installed with centreon-plugin-Network-Cisco-Meraki-Restapi-20240411-123504.el7.noarch) with the mode cache

When I generated a cache for one organization by using filter and statefile option, plugin return seems fine

-bash-4.2$ /usr/lib/centreon/plugins/centreon_cisco_meraki_restapi.pl --plugin=network::cisco::meraki::cloudcontroller::restapi::plugin --mode=cache --hostname='api.meraki.com' --api-token='$MYTOKEN' --port='443' --proto='https' --proxyurl='' --http-backend="curl" --ignore-permission-errors --ignore-orgs-api-disabled --api-filter-orgs='^MYORGANISATION$' --statefile-suffix='_EPI'
OK: Cache files created successfully 

then trying to use the mode devices with cache-use and --statefile-suffix , plugin said there is no cache

-bash-4.2$ /usr/lib/centreon/plugins/centreon_cisco_meraki_restapi.pl --plugin=network::cisco::meraki::cloudcontroller::restapi::plugin --mode=devices --hostname='api.meraki.com' --api-token='$MYTOKEN' --port='443' --proto='https' --proxyurl='' --http-backend="curl" --ignore-permission-errors --ignore-orgs-api-disabled --filter-device-name='${ONEDEVICE}' --warning-total-online='' --critical-total-online='' --warning-total-online-prct='' --critical-total-online-prct='' --warning-total-offline='' --critical-total-offline='' --warning-total-offline-prct='' --critical-total-offline-prct='' --warning-total-alerting='' --critical-total-alerting='' --warning-port-status='' --critical-port-status='' --warning-port-traffic-in='' --critical-port-traffic-in='' --warning-port-traffic-out='' --critical-port-traffic-out='' --warning-link-status='' --critical-link-status='%{link_status} =~ /failed/i' --warning-link-latency='' --critical-link-latency='' --warning-link-loss='' --critical-link-loss='' --warning-traffic-in='' --critical-traffic-in='' --warning-traffic-out='' --critical-traffic-out='' --warning-load='' --critical-load='' --warning-status='' --critical-status='%{status} =~ /alerting/i' --warning-connections-success='' --critical-connections-success='' --warning-connections-auth='' --critical-connections-auth='' --warning-connections-assoc='' --critical-connections-assoc='' --warning-connections-dhcp='' --critical-connections-dhcp='' --warning-connections-dns='' --critical-connections-dns='' --verbose --cache-use --statefile-suffix='_EPI'
UNKNOWN: Cache file missing 

Also when I use the plugin without --api-filter-org options, there is some issue.

-bash-4.2$ time /usr/lib/centreon/plugins/centreon_cisco_meraki_restapi.pl --plugin=network::cisco::meraki::cloudcontroller::restapi::plugin --mode=cache --hostname='api.meraki.com' --api-token='${API_TOKEN}' --port='443' --proto='https' --proxyurl='' --http-backend="curl" --ignore-permission-errors --ignore-orgs-api-disabled
Use of uninitialized value in hash element at /usr/lib/centreon/plugins/centreon_cisco_meraki_restapi.pl line 9028.
Use of uninitialized value in hash element at /usr/lib/centreon/plugins/centreon_cisco_meraki_restapi.pl line 9028.
Use of uninitialized value in hash element at /usr/lib/centreon/plugins/centreon_cisco_meraki_restapi.pl line 9030.
Use of uninitialized value in hash element at /usr/lib/centreon/plugins/centreon_cisco_meraki_restapi.pl line 9028.
Use of uninitialized value in hash element at /usr/lib/centreon/plugins/centreon_cisco_meraki_restapi.pl line 9028.
Use of uninitialized value in hash element at /usr/lib/centreon/plugins/centreon_cisco_meraki_restapi.pl line 9030.
Use of uninitialized value in hash element at /usr/lib/centreon/plugins/centreon_cisco_meraki_restapi.pl line 9028.
Use of uninitialized value in hash element at /usr/lib/centreon/plugins/centreon_cisco_meraki_restapi.pl line 9028.
Use of uninitialized value in hash element at /usr/lib/centreon/plugins/centreon_cisco_meraki_restapi.pl line 9030.
Use of uninitialized value in hash element at /usr/lib/centreon/plugins/centreon_cisco_meraki_restapi.pl line 9028.
Use of uninitialized value in hash element at /usr/lib/centreon/plugins/centreon_cisco_meraki_restapi.pl line 9028.
Use of uninitialized value in hash element at /usr/lib/centreon/plugins/centreon_cisco_meraki_restapi.pl line 9030.
OK: Cache files created successfully 

real	4m6.484s
user	0m2.492s
sys	0m0.417s

I prefer to have separate cache as my API_KEY as multiples organization linked to it. and I have multiples pollers.

Let me know, if you need more information.
Regards

@lucie-dubrunfaut
Copy link
Contributor

Hello :)

For the first problem, were you able to verify that the cache file had been created? Do you have the problem with the devices mode if you don't use the --statefile-suffix option but still filtering with the --api-filter-orgs option? According to my research the output "Cache file missing" seems incomplete to me and you should have something like this "Cache file missing or could not load '. $cache_filename". Overall, I'm not sure that the suffix option is taken into account.

For the second part I investigated a little to find where the uninitialized values ​​were but as I have the new version of the plugin which was released in July the line numbers do not correspond. If you have updated the plugin, can you resend the command to me without the --api-filter-orgs option?

@Thibaud-OBSSA
Copy link
Contributor Author

Thibaud-OBSSA commented Aug 30, 2024

I have updated plugin with latest rpm available.

/usr/lib/centreon/plugins/centreon_cisco_meraki_restapi.pl --plugin=network::cisco::meraki::cloudcontroller::restapi::plugin --mode=cache \
--hostname='api.meraki.com' --api-token="${MERAKI_DASHBOARD_API_KEY}" --port='443' --proto='https' --proxyurl='' --http-backend="curl" \
--ignore-permission-errors --ignore-orgs-api-disabled --api-filter-orgs='^${MY_ORG}$' --verbose
OK: Cache files created successfully

fichier créé => cache_meraki_a1f8a1aac7f35b802221139e8ea68552

/usr/lib/centreon/plugins/centreon_cisco_meraki_restapi.pl --plugin=network::cisco::meraki::cloudcontroller::restapi::plugin \
> --mode=devices --hostname='api.meraki.com' --api-token='${MERAKI_DASHBOARD_API_KEY}' --port='443' --proto='https' --http-backend="curl" \
> --filter-device-name='^A_AMIENS_HOTE_Z3C-W3VR$' \
> --ignore-permission-errors  --ignore-orgs-api-disabled --api-filter-orgs='^CPL-KNG$' --cache-use \
> --verbose 
UNKNOWN: Cache file missing or could not load cache_meraki_a0259a1361ca79d1d7782ab23a43ab86 

Regards

@lucie-dubrunfaut
Copy link
Contributor

Hello :)

Could you check if the file exists manually? (in var/lib/centreon/centplugins if you do not customize the path) Could you also check if the owner is centreon-engine? And finally if the cache file is not empty?
If all this is ok. Would you agree to provide us with the cache file generated (you can anonymise it as much as necessary, we will only use it internally) so that we can troubleshoot this issue on our side? You can send it to my mail address: ldubrunfaut with centreon domain.

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

No branches or pull requests

2 participants