Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 748 of 796  Not logged in ELOG logo
ID Date Icon Author Author Email Categoryup OS ELOG Version Subject
  1793   Wed Apr 5 10:07:59 2006 Reply Stefan Rittstefan.ritt@psi.chRequest 2.6.1Re: Simple math within an elog form

Steve Jones wrote:
Subst TotalRisk = $shell(echo $Risk1 + $Risk2 + $Risk3 > /tmp/elog_out)

What comes out with my simple echo or gawk line is "+ + " so it looks like the attributes are not getting passed into the $shell code?


The reason is that the substitutions get evaluated from left to right, so first the shell is called with $Risk1, and because the shell by itself does a subsitution and $Risk1 is not defined on the unix system, the shell returns an empty string, leading to "+ +" as the result.

I changed that in the current SVN version, so we have first the attribute substitions, then then shell substitution. The "echo $Risk1..." will of course not work, since it gets substituted by elog as "echo 12 + 23 + 45" (or whatever the numbers are), and the "echo" will just return these numbers without adding them. To make the shell to add things, you would need to define the risks as environment variables for the shell, so I guess the "gawk" method will work better for you. I tried it and it worked fine for me.
  1794   Wed Apr 5 13:50:14 2006 Reply Steve Jonessteve.jones@freescale.comRequest 2.6.1Re: Simple math within an elog form

Stefan Ritt wrote:

Steve Jones wrote:
Subst TotalRisk = $shell(echo $Risk1 + $Risk2 + $Risk3 > /tmp/elog_out)

What comes out with my simple echo or gawk line is "+ + " so it looks like the attributes are not getting passed into the $shell code?


The reason is that the substitutions get evaluated from left to right, so first the shell is called with $Risk1, and because the shell by itself does a subsitution and $Risk1 is not defined on the unix system, the shell returns an empty string, leading to "+ +" as the result.

I changed that in the current SVN version, so we have first the attribute substitions, then then shell substitution. The "echo $Risk1..." will of course not work, since it gets substituted by elog as "echo 12 + 23 + 45" (or whatever the numbers are), and the "echo" will just return these numbers without adding them. To make the shell to add things, you would need to define the risks as environment variables for the shell, so I guess the "gawk" method will work better for you. I tried it and it worked fine for me.


Sorry, I waSn't clear about just why I was using "echo". Since elog removes the /tmp/elog_shell temporary file I couldn't "see" what was actually being passed to the shell - gawk was giving me an error and I was flying blind. So I used echo to create my own temporary file.

Yes, gawk should now work -- I'l download and compile the latest and provide feedback.

Thanks!
  1795   Wed Apr 5 18:56:48 2006 Agree Steve Jonessteve.jones@freescale.comRequest 2.6.1Re: Simple math within an elog form

Steve Jones wrote:

Stefan Ritt wrote:

Steve Jones wrote:
Subst TotalRisk = $shell(echo $Risk1 + $Risk2 + $Risk3 > /tmp/elog_out)

What comes out with my simple echo or gawk line is "+ + " so it looks like the attributes are not getting passed into the $shell code?


The reason is that the substitutions get evaluated from left to right, so first the shell is called with $Risk1, and because the shell by itself does a subsitution and $Risk1 is not defined on the unix system, the shell returns an empty string, leading to "+ +" as the result.

I changed that in the current SVN version, so we have first the attribute substitions, then then shell substitution. The "echo $Risk1..." will of course not work, since it gets substituted by elog as "echo 12 + 23 + 45" (or whatever the numbers are), and the "echo" will just return these numbers without adding them. To make the shell to add things, you would need to define the risks as environment variables for the shell, so I guess the "gawk" method will work better for you. I tried it and it worked fine for me.


Sorry, I waSn't clear about just why I was using "echo". Since elog removes the /tmp/elog_shell temporary file I couldn't "see" what was actually being passed to the shell - gawk was giving me an error and I was flying blind. So I used echo to create my own temporary file.

Yes, gawk should now work -- I'l download and compile the latest and provide feedback.

Thanks!


Ok, confirming that this now works. Passing the command:
Subst <attribute> = $shell(gawk 'BEGIN{ print $Attrib1 + $Attrib2 + $Attrib3 }' ) 
will cause the result to be pushed into <attribute>, so gawk in essence becomes a simple calculator and operates on the formula "$Attrib1 + $Attrib2 + $Attrib3".
  1802   Mon Apr 10 05:34:40 2006 Question Steve Jonessteve.jones@freescale.comRequestAll2.6.1-1684TIMEZONE modifier?
We host eLog for a number of global sites. Our logbooks use datetime attributes but the timezones are wrong attributes that are either preset (like when a logentry is created) or if we fill in an attribute from an action (like when a logentry is closed). Any possibility of adding a timezone designator to FORMAT or does one already exist?

Thanks!
  1814   Wed May 3 00:16:42 2006 Idea Mark Bergmanmark.bergman@uphs.upenn.eduRequestLinux2.6.1allow per-logfile attributes to be added/subtracted from the global settings
I think it would be a big enhancement to allow per-logbook attributes to be additions or subtractions from the global attributes, rather than replacing the global settings.

For example, the [global] section of my elogd.cfg reads:

Attributes = Author, Type, Category, Severity, Subject, Entry ID, Status
Extendable Attributes = Type, Category, Severity, Subject, Status
Options Category = Hardware, Software (OS and utilities), Software (Application), Network, Security, Other
Options Severity = None, Low, Medium, High, Critical
Options Status = Open, Closed, In-Progress, Suspended
Options Type = To-Do, Problem Report, Problem Fixed, Informational Note, Software Installation, Configuration, Other
Required Attributes = Type, Category, Subject, Status

I've also got an logbook for each server for hardware issues. Within those logbooks, I'd like to keep all the fields except the software fields, and add fields for memory and storage.

Adding 7 definitions to each server logbook makes the config file huge and difficult to edit, and it means that a future change to the global settings wouldn't propagate to the individual log files. I'd really like to do something like:

[server47]
-Options Category = Software (OS and utilities), Software (Application)
+Options Category = Storage, Memory
-Options Type = Software Installation
+Options Type = RAM Installation, Drive upgrade

As I see it, the initial "-" sign in front of an attribute or option would indicate that the fields listed should be deleted from the global set (if the field name is an exact match), and a leading "+" indicates that the given fields would be added to the global attribute of the same name, for that specific logbook.

The current behavior--without a leading "+" or "-" would be unchanged, so that existing config files don't change.

Thanks,

Mark
  1815   Wed May 3 08:28:05 2006 Reply Stefan Rittstefan.ritt@psi.chRequestLinux2.6.1Re: allow per-logfile attributes to be added/subtracted from the global settings

Mark Bergman wrote:
I think it would be a big enhancement to allow per-logbook attributes to be additions or subtractions from the global attributes, rather than replacing the global settings.


Sounds to me like a good idea. I will put it on the wishlist.
  1822   Sat May 6 02:12:10 2006 Idea Mark Bergmanmark.bergman@uphs.upenn.eduRequestLinux2.6.1suggestion for "new user registration" page
I'm testing elog, and one user was having difficulty creating a new account for himself. This problem had three reasons:

1. the user expected a "submit" button or some other way to exit the account registration screen to appear near the password boxes, at the bottom of the page.

2. I'm using the "Bottom text" option, which has a URL to execute a "find" (search) within elog for all open tickets. The user simply entered the info for their new account, and then clicked on the button at the bottom of the page--which would be the expected behavior.

3. In our environment, there are many logbooks (~100), as each computing device has it's own logbook. This isn't a problem on the main page, since the logbooks are grouped into 7 categories. However, the account registration page combines two functions--setting up a new account, and selecting which logbooks to subscribe to for e-mail notification. The logbooks are presented in a list (rather than groups), which causes the "Save" button at the top left to scroll off the screen before the user enters their password.


Suggestions for improving the registration page:

Put a "submit" button after the password entry.

Possibly supress the local "bottom text", or allow the specification of a different file for the registration page.

After the user has registered, then show a page allowing them to subscribe for e-mail notifcation. That page should be organized the same way as the main page, with groups. Users should be allowed to subscribe to entire groups, or to expand each group to select or unsubscribe from individual logbooks.

Thanks,

Mark
  1823   Mon May 8 18:23:17 2006 Question Stephen A. Woodsaw@jlab.orgRequestLinux Spec file change
Could the "Copyright:" line in the elog.spec file be changed to "License:" for the next release? Without this change an RPM can't be built on FC4 (RPM 4.4.1). With the change, rpms can still be built in Enterprise linux 3 (RPM 4.2.3).
ELOG V3.1.5-fe60aaf