Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for RPC commands with arguments #10

Closed
vishal-yadav opened this issue Apr 12, 2019 · 1 comment
Closed

Support for RPC commands with arguments #10

vishal-yadav opened this issue Apr 12, 2019 · 1 comment

Comments

@vishal-yadav
Copy link

Trying the listed example with below command which gives error:

cookie, err := binrpc.WritePacket(conn, "stats.fetch")
records: [{%!s(int=3) %!s(uint8=0) %!s(int=400)} {%!s(int=41) %!s(uint8=1) Please provide which stats to retrieve}]

However when trying to give specific statistics (or group) it complains that command not found:

cookie, err := binrpc.WritePacket(conn, "stats.fetch current_opened_connections")
records: [{%!s(int=3) %!s(uint8=0) %!s(int=500)} {%!s(int=59) %!s(uint8=1) command stats.fetch current_opened_connections not found}]

cookie, err := binrpc.WritePacket(conn, "stats.fetch tcp:")
records: [{%!s(int=3) %!s(uint8=0) %!s(int=500)} {%!s(int=37) %!s(uint8=1) command stats.fetch tcp: not found}]

Example from kamcmd how the behavior should look like:

$ kamcmd stats.fetch
error: 400 - Please provide which stats to retrieve
$ kamcmd stats.fetch current_opened_connections
{
        tcp.current_opened_connections: 0
}
$ kamcmd stats.fetch tcp:
{
        tcp.con_reset: 0
        tcp.con_timeout: 0
        tcp.connect_failed: 0
        tcp.connect_success: 0
        tcp.current_opened_connections: 0
        tcp.current_write_queue_size: 0
        tcp.established: 0
        tcp.local_reject: 0
        tcp.passive_open: 0
        tcp.send_timeout: 0
        tcp.sendq_full: 0
}

Same requirement as exporter issue #10

@florentchauveau
Copy link
Owner

Hello,

I am very sorry for this late reply!

The command args need to be send separately, like this:

cookie, err := WritePacket(conn, "stats.fetch", "current_opened_connections")

Let me know if you have trouble making it work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants