The remote spy daemon


The main task of a spy daemon is to provide transparent access to events that are not present in a local circular buffer. Furthermore, the spy daemon must balance between high efficiency, obtained prefetching the events, low system load, obtained minimising unneeded event prefetches, and the need of fresh events.


The remote spy daemon connects itself to a remote farm machine, via the farm spy daemon.


Index


Program syntax

rspydaemon [-n processname]


Commands

init [circbuf]
Initialize the process. Must be called at startup and after any error.

The circbuf parameter, if present, sets the lname shared variable.

Puts the process in the INIT_STATE.

start [raddr [rport]]
Connects to the farm spy daemon and starts serving. Can be used only when the process is in the INIT_STATE.

The raddr and rport parameters, if present, set the raddr and rport shared variable respectively.

If the raddr is "-", the process does not connect, but starts serving with no events. Moreover, the raddr shared variable is not updated.

Puts the process in the RUNNING_STATE.

pause
Pauses receiving new envent. Can be used only when the process is in the RUNNING_STATE.

Puts the process in the PAUSE_STATE.

resume
Resume receiving new events (if in PAUSE_STATE).

Puts the process in the RUNNING_STATE.

reconnect [raddr [rport]]
Drop the old connection and connects to another farm spy daemon. Can be used only when the process is in the RUNNING_STATE or PAUSE_STATE.

The raddr and rport parameters, if present, set the raddr and rport shared variable respectively.

disconnect
Drop the old connection, but continue serving empty. Can be used only when the process is in the RUNNING_STATE or PAUSE_STATE.

update
Update shared variables. Can be used only when the process is in the RUNNING_STATE.

end
End serving. Can be used only when the process is in the RUNNING_STATE.

Puts the process in the INIT_STATE.

exit
End serving and kill the process.

Calls the end command before using exit.


Shared variables

Name Type Access Description Default value
runstate INTEGER R Status of the process.

Can be on of the following:

  • UNDEFINED_STATE
  • INIT_STATE
  • RUNNING_STATE
  • PAUSE_STATE
UNDEFINED_STATE
timeout_us INTEGER R/W Timeout time in microseconds 10000
timeoutcounts INTEGER R/W Number of timeouts in a loop 100
timeouts INTEGER R Number of timeout loops from the start of serving. 0

Reset after the start command.

raddr STRING R/W Name of the remote farm machine fibm01-f
rport INTEGER R/W Port address of the farm spy daemon. [system default]
lname STRING R/W Name of the circular buffer. /tmp/B_1_1
circsize INTEGER R/W Size of the circular buffer. 1 Mb
ignored INTEGER R Number of events ignored because too large. 0

Reset after the start command.

maxevents INTEGER R/W Maximum number of events per packet.

-1 means no limit.

-1
no_conn INTEGER R 0 if the daemon is connected to a farm machine, 1 else 1
upfreq INTEGER R/W Long term status update frequency. (Expressed in number of loops)

If ==0, updated at short term update only.

5
upfreq_l INTEGER R/W Short term status update frequency. (Expressed in number of loops)
It also updates long term status.

If ==0, the automatic update is disabled.

10
sg_msecs INTEGER R Miliseconds from the last start or resume. 0

Updated every upfreq cycles.

sg_packs INTEGER R Number of packets received from the last start or resume. 0

Updated every upfreq cycles.

sg_cpu INTEGER R CPU used from the last start or resume. (Expressed in 10-9) 0

Updated every upfreq cycles.

sg_gbytes INTEGER R GBytes received (230) from the last start or resume. 0

Updated every upfreq cycles.

sg_bytes INTEGER R Bytes received (mod GB) from the last start or resume. 0

Updated every upfreq cycles.

sg_uptime INTEGER R The time at the last long term status update. (As reported by time)

Set to 0 if no update yet.

0

Updated every upfreq cycles.

sl_msecs INTEGER R Miliseconds from the last update. 0

Updated every upfreq_l cycles.

sl_packs INTEGER R Number of packets received from the last update. 0

Updated every upfreq_l cycles.

sl_cpu INTEGER R CPU used from the last update. (Expressed in 10-9) 0

Updated every upfreq_l cycles.

sl_bytes INTEGER R Bytes received from the last update. 0

Updated every upfreq_l cycles.

sl_uptime INTEGER R The time at the last short term status update. (As reported by time)

Set to 0 if no update yet.

0

Updated every upfreq_l cycles.


Back to the spy daemons page. Top of the page.
Send comments to: Igor Sfiligoi

Created:15.12.1998
Last modified:15.12.1998