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

Traceback Error on plugin.do_exit() #119

Closed
lgmu opened this issue Sep 15, 2023 · 10 comments
Closed

Traceback Error on plugin.do_exit() #119

lgmu opened this issue Sep 15, 2023 · 10 comments
Milestone

Comments

@lgmu
Copy link

lgmu commented Sep 15, 2023

Hi, I recently updated to v1.6.1 and noticed some errors (but they actually happened before aswell).
Not sure if this is a problem with the plugin or in the redfish module.

Usually it works again on the next retry.

Some system info:
Dell Inc. PowerEdge R840 / Dell Inc. PowerEdge R740
iDRAC 9 (Firmware: 7.00.00.00)

[Traceback (most recent call last):
File "/omd/sites/mon/local/lib/monitoring-plugins/mon/check_redfish/check_redfish.py", line 178, in
plugin.do_exit()
File "/opt/omd/sites/mon/local/lib/monitoring-plugins/mon/check_redfish/cr_module/classes/plugin.py", line 379, in do_exit
self.rf.terminate_session()
File "/opt/omd/sites/mon/local/lib/monitoring-plugins/mon/check_redfish/cr_module/classes/redfish.py", line 359, in terminate_session
self.connection.logout()
File "/omd/sites/mon/local/python/venv/omd_plugin_venv_3.8_current/lib/python3.8/site-packages/redfish/rest/v1.py", line 993, in logout
raise BadRequestError("Invalid session resource: %s, "\
redfish.rest.v1.BadRequestError: Invalid session resource: /redfish/v1/SessionService/Sessions/29857, return code: 401]`

Edit: And I hate that ENTER actually submits the issue while I'm still typing...

@lgmu lgmu changed the title Tracebacm+ Traceback Error on plugin.do_exit() Sep 15, 2023
@bb-Ricardo
Copy link
Owner

Mhh, do you use the --no-session option? Any particular reason?

It is not recommended to use this option as it unnecessary creates a new session on each plugin run.

@lgmu
Copy link
Author

lgmu commented Sep 15, 2023

Yes, we do because either HPE or Dell have a limit of sessions, which we reached. Then nobody could manually login anymore.

In their big environments, we have 1 monitoring host + multiple workers that execute the checks, so the requests come from different IPs (and also different session files).

We don't have any issues with --no-session, just sometimes there is this Traceback exception when the logout fails (but we're speaking about single digit errors with tens of thousands of checks.

@bb-Ricardo
Copy link
Owner

Ahh ok,

This could be solved with an exception handler. But then what should be reported if the logout fails? Just OK?
Can't prove that the session isn't still using a seat at the BMC.
On thebother hand, the check would run into CRITICAL if the bmc juat reaches the session limit.

What do you think?

@lgmu
Copy link
Author

lgmu commented Sep 18, 2023

Assuming it recieved all the data before the logout, I think it's okay to just ignore the logout error.
It doesn't happen that often, so it's pretty unlikely to happen multiple times on the same host until the first session gets killed.

@bb-Ricardo
Copy link
Owner

Hi @lgmu,

I just pushed a fix to "next-release" branch to mitigate this issue. Can you please test it out?

Thank you.

@lgmu
Copy link
Author

lgmu commented Oct 5, 2023

Hi, thanks!
I updated and will test it.

@lgmu
Copy link
Author

lgmu commented Oct 6, 2023

Looks good, thanks!

@lgmu lgmu closed this as completed Oct 6, 2023
@bb-Ricardo
Copy link
Owner

Great that it solved the issue.

Will create another release for this.

@bb-Ricardo bb-Ricardo added this to the 1.7.0 milestone Dec 21, 2023
@giudig
Copy link

giudig commented Feb 9, 2024

Mhh, do you use the --no-session option? Any particular reason?

It is not recommended to use this option as it unnecessary creates a new session on each plugin run.

Hello @bb-Ricardo,
first of all thank you for your contribution with this plugin, very useful and efficient.
After a few months of use I would like to give you just a small suggestion to report what you say here because in the README it is not very clear the impact of --no-session option usage, indicating that it is not recommended to use this option as it unnecessary creates a new session on each plugin run.
Thank you!

@bb-Ricardo
Copy link
Owner

I thought I added this to the readme, will review it again. Thank you

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

3 participants