Hi! excuse me, I need help and I hope you can help me. I want to take a screenshot or get the image of graph. But, it keeps stuck on login page. As we know, graphs in Librenms are in jpg like this:
I want to download it automatically by running python script.
this is the script:
from requests.auth import HTTPBasicAuth
session = requests.session()
requests.get(‘http://192.168.0./login’, auth=HTTPBasicAuth('’, ‘***’)')
But, the output just like this (stuck on login page):
I want the output is the image that showing graph. Thank you.
The format is PNG (default) or SVG depending on your LibreNMS settings.
The example of embedding images in an HTML alert will help you work out how to make this in your python script:
$config['allow_unauth_graphs_cidr'] = array('127.0.0.1/32');
$config['allow_unauth_graphs'] = true;
You need to test or wait until this pull request is merged into the code as currently a bug with unauth graphs https://github.com/librenms/librenms/pull/10483
you could possibly look at LibreNMS API as an alternate way for example "
get_graph_by_portgroup" https://docs.librenms.org/API/PortGroups/ , not sure though if you can pull individual int graphs
I’ve added it. But, still can’t be accessed inside python
Can you browse directly to the image when logged out?
It can be browsed directly through browser, but it keeps failed when run python to get image screenshot
Did you change 127.0.0.1/32 to the real range of device that will try to dowlnload the images ?
I’ve changed it, but it still didn’t work for python