Re: Query keepalived for information such as current priority?

Damien Clabaut <[email protected]> Thu, 23 Aug 2018 12:22:14 +0000
Newsgroups gmane.linux.keepalived.devel
Message-ID <[email protected]>
Paul,

You can dump the state of Keepalived in human-readable format using "kill -s USR1 $(cat /var/run/keepalived.pid)".
This will create a file in /tmp/keepalived.data

For stats, you can use signal USR2 instead. It will create a file in /tmp/keepalived.stats.

Finally, if you want both in json format, you need to compile Keepalived with --enable-json (there is a dependency towards libjson-c when compiling),
you can then use signal 36 (kill -s 36) to create the /tmp/keepalived.json

You can find tools that use these functions here https://github.com/acassen/keepalived/tree/master/tools/json_tracking

Regards,

On Thu, 2018-08-23 at 11:05 +0100, Paul Gildea wrote:
> I am looking for a way to query/poll keepalived for things like priority, state and so forth.
> Is there a way to do this? I see with SNMP some of the information is available, but not all of it such as priority. Is there another way to get
> these details without using SNMP?
> 
> Regards,
> 
> --
> Paul
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Keepalived-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/keepalived-devel
-- 
Damien Clabaut
R&D vRouter
OVH
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot