Hi All, I was hoping someone would know the answer to this question I had... I know the rsync daemon has the "Max connections" module, which works great. However, I was wondering if there was a good way for me to: 1: Query rsync to get the number of live connections it thinks it has? 2: Or better yet, how does rsync itself check for the number of connections? I'm trying to graph the number of folks we have connected at any given time, and running ps, lsof or netstat and parsing with a script is kinda clunky... Does anyone know a better way? Thanks in advance!! -erich
> I'm trying to graph the number of folks we have connected at any given > time, and running ps, lsof or netstat and parsing with a script is kinda > clunky... Does anyone know a better way?I use net-snmp package to count some daemons. I'm sorry I don't use it for rsync daemons, but maybe some help. http://www.net-snmp.org/docs/man/snmpd.conf.html ############################################################################### # Process checks. # # The following are examples of how to use the agent to check for # processes running on the host. The syntax looks something like: # # proc NAME [MAX=0] [MIN=0] # # NAME: the name of the process to check for. It must match # exactly (ie, http will not find httpd processes). # MAX: the maximum number allowed to be running. Defaults to 0. # MIN: the minimum number to be running. Defaults to 0. -- marya at st.jip.co.jp
On Wed, Jan 6, 2010 at 2:06 PM, Erich Weiler <weiler at soe.ucsc.edu> wrote:> 2: Or better yet, how does rsync itself check for the number of > connections? >See the connection.c file in the rsync source for the file locking used (which calls a routine in util.c). Rsync tries to lock a 4-byte range in the file, starting from the start and incrementing by 4 bytes for each slot. So, one way to check for the number of lockers is to use fcntl() with F_GETLK to query the presence of existing locks on the lockfile. ..wayne.. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.samba.org/pipermail/rsync/attachments/20100106/73fad514/attachment.html>
Would 'netstat -antp | grep rsync' get the information youre after? Cheers Tomasz On Wed, Jan 06, 2010 at 02:06:56PM -0800, Erich Weiler wrote:> Hi All, > > I was hoping someone would know the answer to this question I had... > I know the rsync daemon has the "Max connections" module, which > works great. However, I was wondering if there was a good way for > me to: > > 1: Query rsync to get the number of live connections it thinks it has? > 2: Or better yet, how does rsync itself check for the number of connections? > > I'm trying to graph the number of folks we have connected at any > given time, and running ps, lsof or netstat and parsing with a > script is kinda clunky... Does anyone know a better way? > > Thanks in advance!! > > -erich > > -- > Please use reply-all for most replies to avoid omitting the mailing list. > To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync > Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html-- Tomasz M. Ciolek ******************************************************************************* tmc at vandradlabs dot com dot au ******************************************************************************* GPG Key ID: 0x41C4C2F0 GPG Key Fingerprint: 3883 B308 8256 2246 D3ED A1FF 3A1D 0EAD 41C4 C2F0 Key available on good key-servers ******************************************************************************* -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: <http://lists.samba.org/pipermail/rsync/attachments/20100107/eda59bdf/attachment.pgp>