EXAMPLES 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # $id$
  2. sercmd usage examples
  3. help:
  4. sercmd -h
  5. use an udp ser control socket:
  6. ser config:
  7. loadmodule "modules/ctl/ctl.so"
  8. modparam("ctl", "binrpc", "udp:localhost:2046")
  9. modparam("ctl", "binrpc", "tcp:localhost:2046")
  10. modparam("ctl", "binrpc", "unixs:/tmp/unix_stream")
  11. modparam("ctl", "binrpc", "unixd:/tmp/unix_dgram")
  12. sercmd:
  13. sercmd -s udp:localhost:2046 core.version
  14. use a tcp socket:
  15. sercmd -s tcp:localhost:2046 core.version
  16. use a stream unix socket:
  17. sercmd -s unixs:/tmp/unix_stream core.version
  18. use a datagram unix socket:
  19. sercmd -s unixd:/tmp/unix_dgram core.version
  20. list available commands on ser side:
  21. sercmd -s unixd:/tmp/unix_drgam ls
  22. list all available commands (including sercmd builtins or aliases):
  23. sercmd -s unixd:/tmp/unix_dgram ?
  24. or
  25. sercmd -s unixd:/tmp/unix_dgram help
  26. get help on one command:
  27. sercmd -s unixd:/tmp/unix_dgram help core.ps
  28. list ser processes:
  29. sercmd -s unixd:/tmp/unix_dgram ps
  30. send an rpc command to ser:
  31. sercmd -s unixd:/tmp/unix_dgram core.shmmem
  32. format the output:
  33. sercmd -s unixd:/tmp/unix_dgram -f 'pid:%v desc:"%v"\n' core.ps
  34. (note: you could use just ps instead of core.ps)
  35. format the output as csv:
  36. sercmd -s unixd:/tmp/unix_dgram -f '%v,' core.ps
  37. enter interactive mode:
  38. sercmd -s unixd:/tmp/unix_dgram
  39. (note: type help,or ? to see the command list, tab expansion should also
  40. work)