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

invalid username or password error but curl works #25

Closed
what5150 opened this issue Aug 17, 2021 · 2 comments
Closed

invalid username or password error but curl works #25

what5150 opened this issue Aug 17, 2021 · 2 comments

Comments

@what5150
Copy link

I'm sure I'm doing something wrong, as I'm new to icinga2/nagios, but when I run '/usr/lib/nagios/plugins/check_pve.py -u monitoring@pve -p blablabla -k -e pve1.ncimfg.com -p 8006 -m '$anyCheck' I get 'UNKNOWN - Could not fetch data from API: Could not connection to PVE API: invalid username or password'

FYI, I have very little experience with python.
I had to change
from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
to
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

Before that change it would return nothing. So I may have something wrong, but I can curl and get a token using the username and password, then using the token, I can curl and get data from the API. So I'm sure the password is correct.

I have tried to print from inside def get_ticket(self): (not sure if you can do that in python), but I get nothing on the command line. I'm not sure if get_ticket is happening at all now.

Any help would be appreciated.

@nbuchwitz
Copy link
Owner

Changing something in the source code shouldn't be necessary. What versions did you use?

  • Icinga host
    • Python version
    • output of ls -l /usr/bin/python3
    • OS family
    • OS version
  • PVE version

@nbuchwitz nbuchwitz added needs-more-information question Further information is requested and removed needs-more-information labels Sep 10, 2021
@nbuchwitz
Copy link
Owner

I'm closing this, because no feedback was received.

@nbuchwitz nbuchwitz removed the question Further information is requested label Jan 1, 2022
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