Skip to content

Trigger action when WebUI is not opened #2845

Answered by nicolargo
attilabalazsy asked this question in Q&A
Discussion options

You must be logged in to vote

@attilabalazsy

I have a possible workaround for your need. As i said, Glances actions are only triggered if a client is connected. When a server with a -w option is launch, nothing is done until a client send a request. By client we mean the Glances Web UI or a simple "curl" process ran every 'n' minutes.

My proposal is to create a simple glancestrigger.sh script:

#!/bin/sh  
curl -s -o /dev/null http://<YOUR GLANCES SERVER>:61208/api/3/all

-s si for silent mode
-o is to redirect the output to a file (nothing with /dev/null)
is the IP @ or name of your Glances server (or localhost if your script is ran on the same host.

Then cron this script every 'n' minutes.

# crontab -e
* * * * * /pat…

Replies: 9 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by nicolargo
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
3 participants
Converted from issue

This discussion was converted from issue #2240 on June 21, 2024 11:38.