HTML Notification doesn't include graphs anymore - Failed to fetch graphs - connection refused

CMK version: Raw-Edition 2.2.0p4
OS version: Debian 10

Description of the problem: HTML Notification doesn’t include graphs anymore - Failed to fetch graphs

**Error message:**Notification sendmail error: Failed to fetch graphs: <urlopen error [Errno 111] Connection refused> – URL: http://localhost:5000/DEHA/check_mk/ajax_graph_images.py?

Hello,
I guess the error started as I enabled https for our check_mk but I can’t be sure as I recognized the issue quite later.

Tried to find the reason and therefore investigated /opt/omd/sites/DEHA/etc/apache/conf.d/check_mk.conf but this looks ok for me:

#  Webservice for graph images used by notifications
<Location "/DEHA/check_mk/ajax_graph_images.py">
    Order allow,deny
#    Deny from all
    Allow from all
    Satisfy any
</Location>

I am grateful for any help.

Thanks & Regards,
Sascha

Hi
I had the same error, so I investigated this some more, and, As I found out, removing the check on this option eliminates this error.
BTW, this error doesn’t prevent the mail from being sent.

But I don’t know where to configure this option to have the correct value.

1 Like

Thank you giliredbaron,

I will give it a try. But I do not only want to get rid of the errors, I also like to have the graphs send by mail as it had been before.

Perhaps someone can point me to a solution?

Best,
Sascha

Hi @SasMei and welcome to the community. :v:

The chances are very likely that this had influence on your problem. Can you share how you enabled the HTTPS on your Checkmk server? How is your Apache config looking like?

And can you see what happens if you try to curl http://localhost:5000/DEHA/check_mk/ajax_graph_images.py?… on the Checkmk server?

Thanks in advance!

Regards
Norm

1 Like

Hi Norm,

thanks for your input.

On the check_mk server itself (the localhost) curl of http://localhost:5000/DEHA/check_mk/ajax_graph_images.py?… resolves in an error: curl: (7) Failed to connect to localhost port 5000: Connection refused

But if I use IP instead of localhost everything is fine. So I guess apache is blocking localhost.

I enabled https for the server following this documentation: https://docs.checkmk.com/latest/en/omd_https.html

This is the apache configuration file for my check_mk site:

# version: 2
# This file is managed by 'omd' and will automatically be overwritten. Better do not edit manually

# Make sure that symlink /omd does not make problems
<Directory />
  Options +FollowSymlinks
</Directory>

<IfModule mod_proxy_http.c>
  ProxyRequests Off
  ProxyPreserveHost On

  <Proxy http://10.102.139.205:5000/DEHA>
    Order allow,deny
    allow from all
  </Proxy>

  <Location /DEHA>
    # Setting "retry=0" to prevent 60 second caching of problem states e.g. when
    # the site apache is down and someone tries to access the page.
    # "disablereuse=On" prevents the apache from keeping the connection which leads to
    # wrong devlivered pages sometimes
    ProxyPass http://10.102.139.205:5000/DEHA retry=0 disablereuse=On timeout=120
    ProxyPassReverse http://10.102.139.205:5000/DEHA
  </Location>
</IfModule>

<IfModule !mod_proxy_http.c>
  Alias /DEHA /omd/sites/DEHA
  <Directory /omd/sites/DEHA>
    Deny from all
    ErrorDocument 403 "<h1>Checkmk: Incomplete Apache Installation</h1>You need mod_proxy and
    mod_proxy_http in order to run the web interface of Checkmk."
  </Directory>
</IfModule>

<Location /DEHA>
  ErrorDocument 503 "<meta http-equiv='refresh' content='60'><h1>Checkmk: Site Not Started</h1>You need to start this site in order to access the web interface.<!-- IE shows its own short useless error message otherwise: placeholder -->"
</Location>

This could already be the reason ( I am not that experienced in apache configuration). I will try to figure out if I also can add LOCALHOST into that configuration.

I am grateful for suggestions on this.

Thanks & Regards,
Sascha

Hey,

I managed to solve the issue.

First of all I changed in my omd config MYSITE the Apache_TCP_Port back to 127.0.0.1

Then (as I had no access to the website anymore from other devices) I ran omd update-apache-config MYSITE

Now I have graphs back in my notifications and no errors :smiley:

Thank you to all!

Best,
Sascha