How to monitor several Plesk Servers with Grafana extension?

Follow

Comments

6 comments

  • Avatar
    Mark S.

    Hello, I am using the Grafana extension ( Advanced Monitoring) included in Obsidian and would like to add PROMETHEUS as Data Source.

    [ext-grafana]
    allowSuperAdmin = true

    is stored in the Panel.ini. Unfortunately the integration of Prometheus does not work...
    I followed these instructions https://prometheus.io/docs/visualization/grafana/#creating-a-prometheus-data-source

    But I only get this error: Unknown error during query transaction. Please check JS console logs.
    This one again says nothing ...
    Anybody got an idea?


    Greetings

    1
    Comment actions Permalink
  • Avatar
    Jacob D Dean (Edited )

    Hi,

    I followed these instructions for my Plesk Obsidian server running v18.0.28 and get the success message when creating the data source "Data source is working," but when I go to add a panel to the dashboard and select the data source, I get an "Internal server error" response:

     

    For reference, I am running Grafana locally on a MacBook. I've also tried running inside a Docker on the target machine and I get the same error. I have my IP whitelisted in the Plesk firewall for port 3000 and 8443, but the fact that it seems to test successfully when setting up the data source leads me to believe that is not the issue.

     

    *************** Update **************

    It appears it errors out on creation if you don't have a query, which makes sense, but I guess I expected a default query like in the animated screenshot in this article. It's a little confusing for Grafana to throw an error first thing, but that's not something you guys handle.

    I am still having trouble with the filterable list of query options. I have to manually enter the query, for example: "cpu:percent-user:value".

    Although, I figured out that you can inspect the JSON formatting of the Grafana panels in Plesk by left-clicking on the panel title, select "Inspect" and clicking "Panel JSON." Click "Copy to clipboard,", then paste it in your custom Grafana instances' panel by doing the same. Just make sure to reselect your data source before saving. 

    0
    Comment actions Permalink
  • Avatar
    Anton Maslov

    Mark S. we did not test integration with PROMETHEUS as a data source. Based on error it looks like Prometheus does not respond properly to query. My first advice would be to check that Prometheus server URL is accessible form server itself. E.g. if you use http://localhost:9090/ like in example make sure you may connect to it from SSH:

    # telnet localhost 9090

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello Jacob D Dean

    Thank you for sharing your user experience.

    In case getting stuck on one of the further stages, I suggest also contacting Grafana developers: https://github.com/grafana/grafana/issues/

    0
    Comment actions Permalink
  • Avatar
    Jacob D Dean

    Ivan Postnikov

    I will reach out to Grafana and/or the plugin developer, but in the meantime, is there anywhere I can get a list (or API query that will list) of all of the metrics available from Plesk that I can use in Grafana?

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello Jacob D Dean

    Sorry for the late response.

    There's a way to provide all the metrics straight to Grafana.

    Metrics are available at https://example.com:8443/modules/monitoring/public/index.php/AUTH_TOKEN

    AUTH_TOKEN is stored in Plesk database, to get it (example output from a test server):

    # plesk db "Select value from ModuleSettings Where name = 'rrd_api_auth_token'"
    +------------------------------------------+
    | value |
    +------------------------------------------+
    | _qzuAPkvl_BhbQd7ndj1_r_n-6av4FDfCSqHbwwL |
    +------------------------------------------+

    Use that URL as described here at "3. Add the datasource to Grafana".

    This link leads to a blog, it's very detailed and you should be able to configure everything on your side.

     

    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request