I need help with nagios check for our server https://download.copr.fedorainfracloud.org/. We used this check last week https://pagure.io/fedora-infra/ansible/c/c9951efa8dae87d17a656f9dbf622b0344d5a7e5?branch=main but it didn't work HTTP CRITICAL: HTTP/1.1 503 Service Unavailable - string 'Index of /' not found on 'https://download.copr.fedorainfracloud.org:443/' - 3692 bytes in 0.631 second response time I'm not sure why it didn't work because the string is there.
I would appreciate some tips on what to change.
I started a fix for you but didn't implement it because I am underwater in other work.
The fix is that it is a redirect so it needs ot use the _follow_ssl. All that needs to be done is uncomment the current code and make it look like:
define service { hostgroup_name proxies service_description http-download.copr.fedorainfracloud.org check_command check_website_follow_ssl!download.copr.fedorainfracloud.org!/!Index of / max_check_attempts 8 use websitetemplate }
The previous version you tried didn't work because it was missing a !/! before the Index of/ in the code. It is a friday so I don't want to push the change live until Monday.
Index of/
Commit db6dc989 fixes this issue
Metadata Update from @schlupov: - Issue status updated to: Open (was: Closed)
This does not seem to be the right solution. Why is a redirect needed? For example, id.fedoraproject.org also redirects and there is no need to add -f follow
-f follow
Metadata Update from @mohanboddu: - Issue priority set to: Waiting on Assignee (was: Needs Review) - Issue tagged with: low-gain, low-trouble, ops
Yes, this is not gonna work. ;)
What this does is says, on each host in proxies group, connect to that host via https and ask it for download.copr.fedorainfracloud.org (ie, the virtual host, which doesn't exist on proxies) and check the contents of that.
The easiest way forward here would be to just do something like we do for www.fedorastatus.org. See roles/nagios_server/templates/nagios/services/websites.cfg.j2 and roles/nagios_server/templates/nagios/hosts/other.cfg.j2 This will just do one check from noc01 to it however.
If you really need it to be checked by all the proxies thats going to be a lot more complex. Needs to install check_http on all the proxies and use a new custom command that does a nrpe call/check to each proxy to run the check_http plugin to check the site from there. :(
I think we might want to just check from noc01 for now and look at making it more robust when we switch to zabbix...
So this code should work?
define service { host_name noc01.iad2.fedoraproject.org service_description http-download.copr.fedorainfracloud.org check_command check_website_ssl!download.copr.fedorainfracloud.org!/!Index of / max_check_attempts 8 use websitetemplate }
You will want to define a host of 'download.copr.fedorainfracloud.org' and use it in host_name... by default checks run from noc01, host_name says what host to connect to and check_command has the command and parameters.
So, like status you will want a download.copr.fedorainfracloud.org in that hosts/other.cfg.j2, then use that in the service entry...
Can you please check this PR https://pagure.io/fedora-infra/ansible/pull-request/958 if I understood correctly your last comment?
Yes, that one looks good to me.
Can I consider this issue resolved?
Yeah. I think so... it's now being monitored. ;)
Metadata Update from @kevin: - Issue close_status updated to: Fixed - Issue status updated to: Closed (was: Open)