Risto,
I have a Feature request. I would like options to pass SECRC and create
a title via the shell command line.
For a while now I have been uncomfortable with the SEC's use of the
process table. You can see what is going on in the process table, but
if there are a number of files being monitored, the line is difficult to
read creating some confusion. Add to that the explicit use of path
names, and the process table line gets even longer, exacerbating the
confusion. System5 unix (solaris) only exposes a limited number of the
commandline, and the salient details of SEC may become invisible. I
would like something to simplify the process table to make it easier to
read.
Example:
sec 11693 0.0 0.5 11808 5556 ? S 09:28 0:00
/usr/local/bin/perl -w /usr/local/bin/sec.pl -detach -conf=/sec/sec.cfg
-input=/remote/machine-a/log/messages -input=/var/log/messages
-input=/sec/backups.current -pid=/sec/sec.pid -log=/sec/sec.log
-dump=/sec/sec.dump -debug=4 -intevents
From the man pages, I see that you can improve things somewhat by
pushing command line info into a file and creating a SECRC environment
variable. SEC is then fired off with no arguments. As an additional
benefit, you can use the file as a pseudo include mechanism, or a master
configuration. Similar to monitoring multiple input files, if you wish
to break the config into multiple files, you can. Just create multiple
-conf= lines.
However, within my group, there is a dislike of the cleaning out the
process table, because that by setting a SECRC environment variable, the
process becomes more difficult to grasp what is going on. At least with
something explicit on the command line, the environment is accessible to
a larger group, instead of encouraging spelunking.
I am also interested in 'naming' or providing 'titles' to the sec
processes. I may have a number of them running, some associated with a
given service, or modularized to a view or instance of a service, or I
may have a SEC process running for debugging or testing new code.
Example:
sec 3013 0.0 0.2 2439688 7260 s006 S+ 12:04PM 0:00.15
/usr/local/bin/perl -w /usr/local/bin/sec.pl
-secrc=/usr/local/myproject/secrc -title=testing
Attached is a unified diff that should be suitable as a patch to
sec-2.5.3. The patch should provide for the 'title' in the commandline,
as well as passing in the SECRC via the shell command line.
Regards,
Tim Peiffer
--
Tim Peiffer
Network Support Engineer
Office of Information Technology
University of Minnesota/NorthernLights GigaPOP
+1 612 626-7884 (desk)
--- sec.pl 2010-11-27 18:56:07.000000000 -0600
+++ sec.pl.new 2010-12-11 12:01:17.000000000 -0600
@@ -127,6 +127,8 @@
$terminate
$testonly
$timeout_script
+ $title
+ $secrc
%variables
$version
$WIN32
@@ -179,6 +181,8 @@
-intevents, -nointevents
-intcontexts, -nointcontexts
-testonly, -notestonly
+ -title=<title>
+ -secrc=<path to SECRC>
-help, -?
-version
!;
@@ -8303,6 +8307,8 @@
$intevents = 0;
$intcontexts = 0;
$testonly = 0;
+ $title = '';
+ $secrc = '';
$help = 0;
$version = 0;
@@ -8331,6 +8337,8 @@
"intevents!" => \$intevents,
"intcontexts!" => \$intcontexts,
"testonly!" => \$testonly,
+ "title=s" => \$title,
+ "secrc=s" => \$secrc,
"help|?" => \$help,
"version" => \$version );
@@ -8358,6 +8366,11 @@
# ------------------------- MAIN PROGRAM -------------------------
##################################################################
+### Set and Pass the SECRC environment via commandline if available.
+if ($secr) {
+ $ENV{'SECRC'} = $secrc;
+}
+
### Read and process SEC options from command line and resource file
read_options();
@@ -8376,6 +8389,11 @@
exit(0);
}
+### Reset command line if a title is used.
+if ($title) {
+ $0 = "sec.pl -title=$title";
+}
+
### Open logfile
if ($logfile) { open_logfile($logfile); }
@@ -8423,6 +8441,7 @@
}
}
+
### Set signal handlers
$refresh = 0;
------------------------------------------------------------------------------
Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
new data types, scalar functions, improved concurrency, built-in packages,
OCI, SQL*Plus, data movement tools, best practices and more.
http://p.sf.net/sfu/oracle-sfdev2dev
_______________________________________________
Simple-evcorr-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users