Hi Team,
We are trying to automation nagios deployment using ansible . And when im running the Job which has 16+ tasks ( to deploy 16 relevant services ) its failing with error "Status code was not [200]: Request failed: <urlopen error [Errno 104] Connection reset by peer>".
Is there any limitation on nagios end to invoke sequential or paraellel REST calls ?
Also any relevant logs i can see what exactly is happening ?
Nagios Request API : Request failed: <urlopen error [Errno 1
-
veeravamsi
- Posts: 145
- Joined: Wed Jan 23, 2019 3:35 am
Re: Nagios Request API : Request failed: <urlopen error [Err
Hi,
This doc describes the various Nagios XI logs:
https://assets.nagios.com/downloads/nag ... ptions.pdf
I'd start with /usr/local/nagios/var/nagios.log
As far as limitations on the API, from what I could find, this hasn't been an issue. But you guys might be
the first to be hitting it so quickly. Did any of the REST calls succeed?
Let me know if you can't find anything in logs, and I will mock something up on my system.
Also please send me a System Profile and I can help you look through the logs.
To send us your system profile.
1. Login to the Nagios XI GUI using a web browser.
2. Click the "Admin" > "System Profile" Menu
3. Click the "Download Profile" button
4. Save the profile.zip file and share this in a private message and then reply to this post to bring it up in the queue.
Thanks
This doc describes the various Nagios XI logs:
https://assets.nagios.com/downloads/nag ... ptions.pdf
I'd start with /usr/local/nagios/var/nagios.log
As far as limitations on the API, from what I could find, this hasn't been an issue. But you guys might be
the first to be hitting it so quickly. Did any of the REST calls succeed?
Let me know if you can't find anything in logs, and I will mock something up on my system.
Also please send me a System Profile and I can help you look through the logs.
To send us your system profile.
1. Login to the Nagios XI GUI using a web browser.
2. Click the "Admin" > "System Profile" Menu
3. Click the "Download Profile" button
4. Save the profile.zip file and share this in a private message and then reply to this post to bring it up in the queue.
Thanks
-
veeravamsi
- Posts: 145
- Joined: Wed Jan 23, 2019 3:35 am
Re: Nagios Request API : Request failed: <urlopen error [Err
I will check with my team if i can share our nagios profile/configuraiton.
Meanwhile wanted to check if there is any better way of REST Calls to deploy multiple services at once ? like using Templates or something else ?
Meanwhile wanted to check if there is any better way of REST Calls to deploy multiple services at once ? like using Templates or something else ?
Re: Nagios Request API : Request failed: <urlopen error [Err
Hi
I haven't used Ansible so I don't know if this is possible but as part of an experiment/troubleshooting
could you queue up the API calls so they run serially instead of in parallel ? Would like to confirm that
the concurrent requests are the issue.
Thanks
I haven't used Ansible so I don't know if this is possible but as part of an experiment/troubleshooting
could you queue up the API calls so they run serially instead of in parallel ? Would like to confirm that
the concurrent requests are the issue.
Thanks
-
veeravamsi
- Posts: 145
- Joined: Wed Jan 23, 2019 3:35 am
Re: Nagios Request API : Request failed: <urlopen error [Err
Sure . Here is sample :
url: https://{{ xi_ip }}/nagiosxi/api/v1/config/service?apikey={{ xi_api_key }}
body: "host_name={{ host_fqdn }}&service_description=Service status for: NCPA Listener Service&check_command=check_xi_ncpa\\!-t '{{ ncpa_token }}' -P 5693 -M 'services' -q 'service=ncpa_listener,status=running'&max_check_attempts=6&check_interval=60&retry_interval=10&check_period=xi_timeperiod_24x7&contacts=nagiosadmin¬ification_interval=60¬ification_period=xi_timeperiod_24x7"
method: POST
url: https://{{ xi_ip }}/nagiosxi/api/v1/config/service?apikey={{ xi_api_key }}
body: "host_name={{ host_fqdn }}&service_description=Service status for: NCPA Listener Service&check_command=check_xi_ncpa\\!-t '{{ ncpa_token }}' -P 5693 -M 'services' -q 'service=ncpa_listener,status=running'&max_check_attempts=6&check_interval=60&retry_interval=10&check_period=xi_timeperiod_24x7&contacts=nagiosadmin¬ification_interval=60¬ification_period=xi_timeperiod_24x7"
method: POST
Re: Nagios Request API : Request failed: <urlopen error [Err
Hi,
Sorry I wasn't clearer.
I meant could you send one request, wait for a response, send the next request, wait for a response, etc
I want to see if the requests completes successfully when sent one at a time
Thanks
Sorry I wasn't clearer.
I meant could you send one request, wait for a response, send the next request, wait for a response, etc
I want to see if the requests completes successfully when sent one at a time
Thanks
-
veeravamsi
- Posts: 145
- Joined: Wed Jan 23, 2019 3:35 am
Re: Nagios Request API : Request failed: <urlopen error [Err
No luck. I tried adding sleep() 30seconds till a minutes between statements . Its not like its unable to add but completes say 4 or 6 APIs and throws errors for 7th one. its random.
Also is it possible for me to create template or Custom API for say set of 10 services and then invoke as single call ?
Also is it possible for me to create template or Custom API for say set of 10 services and then invoke as single call ?
Re: Nagios Request API : Request failed: <urlopen error [Err
Hi,
Thanks for trying.
You can't create a custom api.
You could use a template, but templates are designed for use on one machine at a time, as opposed to
being able to include multiple hosts.
I talked to one of the developers and he said:
Thanks
Thanks for trying.
You can't create a custom api.
You could use a template, but templates are designed for use on one machine at a time, as opposed to
being able to include multiple hosts.
I talked to one of the developers and he said:
Let me know about the forceapply GET please.I vaguely remember using the API to generate thousands of services through a python script at one point, so I doubt it's a rate limit. He's not using the forceapply GET variable with every callinside Ansible, is he?
Thanks
-
veeravamsi
- Posts: 145
- Joined: Wed Jan 23, 2019 3:35 am
Re: Nagios Request API : Request failed: <urlopen error [Err
I figured out whats blocking ... in my api i have dependency to map the HostGroup/ServiceGroup , so when those are missing im getting this error . May be a better API response would help from nagios ?
Re: Nagios Request API : Request failed: <urlopen error [Err
Hi,
Good find.
I'll submit a feature request for a more informative
API response on your behalf.
Please keep in mind that the decision to implement an enhancement is at
the discretion of our development team.
Thanks
Good find.
I'll submit a feature request for a more informative
API response on your behalf.
Please keep in mind that the decision to implement an enhancement is at
the discretion of our development team.
Thanks