kamailio_exporter
kamailio_exporter copied to clipboard
Feature: add rpc methods with parameters
Hi, would it be possible to add rpc methods which need parameters?
Adding methods without parameters is quite easy but I'm not sure how I should proceed (I suppose some changes on the binrpc library are needed)
Hello!
Could you give me an example of RPC method with parameters so I can make some tests?
Best
hello, here's an example:
mod.stats core shm
Thank you
Below case is in particular useful where you can scrape any specific (group) statistics listed in kamcmd stats
. For example:
kamcmd stats.get_statistics <statistics_name>
kamcmd stats.get_statistics <group:>
Hello guys,
The binrpc package can already handle this, command args need to be appended to the WritePacket function.
Like this:
cookie, err := binrpc.WritePacket(conn, "stats.fetch", "current_opened_connections")
Implementing this in the exporter would be trivial, we could split a command by " "
(space) in the fetchBINRPC
function.
However, it would be interesting to have a more dynamic list of commands I think. Or maybe we just need to implement stats.fetch all
that is available since Kamailio 5.X.