Difference between revisions of "Src-perl-querylogger"

From IARC 207 Wiki
Jump to navigation Jump to search
imported>Ken
 
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
This perl script was written to exercise and test the Campbell::Comm
+
=querylogger.pl=
 +
This perl script was written to exercise and test the [[Src-perl-Campbell::Comm|Campbell::Comm]]
 
module, but may be useful in its own right as a way to interface with
 
module, but may be useful in its own right as a way to interface with
 
dataloggers in batch (i.e., non-interactive) form.  Each method in the
 
dataloggers in batch (i.e., non-interactive) form.  Each method in the
Line 27: Line 28:
 
         binary=n    n=number of data locations to get
 
         binary=n    n=number of data locations to get
 
         program      print all logger programming
 
         program      print all logger programming
         flags        optionally toggle specified flag(s), show flags
+
         flags=n       optionally toggle specified flag(s), show flags, n=flag number
 
         ports        show ports (toggle not yet supported)
 
         ports        show ports (toggle not yet supported)
 
         memory      show mode A memory settings  
 
         memory      show mode A memory settings  
Line 35: Line 36:
 
         get_time_flags experimental using F command
 
         get_time_flags experimental using F command
  
The querylogger (and loggerdata) scripts assume a specific system  
+
The querylogger (and [[Src-perl-loggerdata|loggerdata]]) scripts assume a specific system  
 
configuration of sites and ''rc'' files; see below...
 
configuration of sites and ''rc'' files; see below...
 +
 +
This program started as a ''quick hack'', and takes some shortcuts.  It really ought to provide -h and/or --help options to show the above information, but it doesn't.
 +
 +
The program is "tied to" the particular/peculiar site architecture we've chosen to use; but that's just how we use it, so perhaps it's not so bad.
 +
 +
The program uses a different scheme for identifying sites: it just uses the site name, trying to match against the full list of sites it builds by walking the site root tree looking for .siterc files.  This could maybe be simplified, just by NOT DOING THAT.  But it's what it is.
 +
 +
Our main use of this utility is for quick operations such as setting or clearing flags, or looking at the site timestamp.
 +
 +
  A quick example:
 +
  bob@shand:/home/site/atlas$ querylogger anvil flags=1

Latest revision as of 09:40, 6 May 2008

querylogger.pl

This perl script was written to exercise and test the Campbell::Comm module, but may be useful in its own right as a way to interface with dataloggers in batch (i.e., non-interactive) form. Each method in the Campbell::Comm module should be represented by a querylogger command as specified on the command line.

The interface is described if run with no arguments:

   $ querylogger
   syntax: "$ /home/ken/bin/querylogger OPTIONS SITE COMMAND ...
   where OPTIONS are
       --quiet      suppress output to STDOUT
       -q           same as above
       --logfile=f  print everything to file f 
       -l f         same as above
       --comm=s     use rc file section Campbell::Comm-s, or
       -c s         use rc file section Campbell::Comm-s
       --identify   identify site in output (default)
       --noidentify don't identify site in output
   where SITE is one of: site, slope_mtn,
   and COMMANDs may include:
       status       list status strings
       time         show time (setting not yet supported)
       backup=n     n=number of output arrays to spew (no limit)
       MPTR=loc     loc=output storage location (no limit)
       data=n       n=number of data records to get
       binary=n     n=number of data locations to get
       program      print all logger programming
       flags=n        optionally toggle specified flag(s), show flags, n=flag number
       ports        show ports (toggle not yet supported)
       memory       show mode A memory settings 
       signatures   show mode B signature settings
       input=n[,m][,r-s]  show input storage locations
       capture=[f]  end previous capture, capture output to file f
       get_time_flags experimental using F command

The querylogger (and loggerdata) scripts assume a specific system configuration of sites and rc files; see below...

This program started as a quick hack, and takes some shortcuts. It really ought to provide -h and/or --help options to show the above information, but it doesn't.

The program is "tied to" the particular/peculiar site architecture we've chosen to use; but that's just how we use it, so perhaps it's not so bad.

The program uses a different scheme for identifying sites: it just uses the site name, trying to match against the full list of sites it builds by walking the site root tree looking for .siterc files. This could maybe be simplified, just by NOT DOING THAT. But it's what it is.

Our main use of this utility is for quick operations such as setting or clearing flags, or looking at the site timestamp.

 A quick example:
 bob@shand:/home/site/atlas$ querylogger anvil flags=1