Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 98 of 806  Not logged in ELOG logo
icon13.gif   Upgrade to 2.6.4 broke quick search, posted by T. Ribbrock on Tue Mar 6 16:59:13 2007 
Hi!

I just went from 2.6.1 to 2.6.4 and since the upgrade, the quick search drop-down menus no longer work. I can select an attribute, but when I do so, I only get an empty page with the following message:
Attachment #0 of entry #0 not found
Please use your browser's back button to go back

When I do go back, the attribute I selected is still selected, but all entries are listed. With 2.6.1, this worked like a charm.

Any idea?

Thanks in advance,

Thomas
    icon14.gif   Re: Upgrade to 2.6.4 broke quick search, posted by T. Ribbrock on Tue Mar 6 17:03:43 2007 

T. Ribbrock wrote:

[...]
I just went from 2.6.1 to 2.6.4 and since the upgrade, the quick search drop-down menus no longer work. I can select an attribute, but when I do so, I only get an empty page with the following message:
Attachment #0 of entry #0 not found
Please use your browser's back button to go back
[...]


Apparently, this must have been some session-oddity - I just logged out and got an error message about a bad URL. I then went to the base URL of the logbook (i.e. http://server:8080), chose the correct logbook and logged in again. Things work fine since. No idea what went wrong the first time round... Frown

Regards,

Thomas
icon4.gif   Using the command line tool to edit, posted by T. Ribbrock on Thu Aug 7 10:12:25 2008 

I intend to create a script that updates one of our elog logbooks based on mails it receives. I was hoping to be able to do this using the "elog" command line tool. Adding a new entry works fine, as does "replying" to an existing entry. The only thing I cannot get to work is editing an existing entry. All entries ahve several attributes and I intend not to use the "message" itself. I tried the following (on the machine this elogd is running on):

  1. Create a new entry with Attribute1 set to "value":

    elog -a 'Attribute1=value' -x -h localhost -l 'LOGBOOK' -p 8080 -u USER PASSWD

    This works - the entry gets created and is displayed properly.
    NOTE: I found that this does not work if LOGBOOK has any spaces in it - I would get error messages where the logbook was not found.
     
  2. Edit this entry to set a second attribute:

    elog -e 1 -a 'Attribute2=something' -x -h localhost -l 'LOGBOOK' -p 8080 -u USER PASSWD

    The result was: Error transmitting message. Running the same command with -v gives me a whole bunch of text with at the end this message (I've stripped the HTML): "This entry has in meantime been modified by someone else. Submitting it now would overwrite the other modification and is therefore prohibited." However, I know for certain that this entry is not being editied by anyone at that moment, so I'm wondering what I'm doing wrong here...

Also, I have a second, related question: Editing by the ID of the entry seems to be the only way of editing an entry - this makes it a bit difficult for me, as all entries already have a unique ID (which is defined as one of the attributes) that is non-numerical and not sequential. What is the easiest way to retrieve an ID from the command line (basically something like: "What ID has the entry with Attribute1==NAME?")? Is it possible at all? Otherwise, I would not be able to automatically edit the entries, as I don't know which is which... :-}

    icon2.gif   Re: Using the command line tool to edit, posted by T. Ribbrock on Fri Aug 8 14:50:56 2008 

Yoshio Imai wrote:

T. Ribbrock wrote:
NOTE: I found that this does not work if LOGBOOK has any spaces in it - I would get error messages where the logbook was not found.


You might try to escape the space in the form
elog -a 'Attribute1=value' -x -h localhost -l 'LOG\ BOOK' -p 8080 -u USER PASSWD


I forgot to mention that I tried both 'LOG\ BOOK' and 'LOG%20BOOK' - neither worked. Running elog with -v seemed to indicate in both cases that the correct logbook could not be found.



Yoshio Imai wrote:

T. Ribbrock wrote:
What is the easiest way to retrieve an ID from the command line

I don't know if this helps you (depends on how much the application that edits the entry communicates with the application the generates the entry), but the elog client should output something like
Message successfully transmitted, ID=12345
which you could e.g. redirect into a file that the editing application then reads to determine the ID.


Good point, thanks - I'll have to generate some kind of mapping table (ID<->Attribute) when the logbook gets populated, but that should be possible. It would be very cool, though, if elog was able to identify an entry by attribute value - maybe something for a day when Stefan gets bored... Wink

However, none of this will have any relevance unless I can solve the non-working "edit" function... Frown
    icon2.gif   Re: Using the command line tool to edit, posted by T. Ribbrock on Mon Aug 11 15:14:40 2008 
Stefan Ritt wrote:

I fixed two things:

  • The logbook can now contain a space. Enclose it in double quotes such as elog -l "LOG BOOK" ...
  • The error you report comes from the fact that you are the first person using elog submissions together with "use lock=1" in the configuration file. This has never been tested and therefore does not work . So I fixed this by adding a new hidden parameter. If you update to SVN revision 2122, things should work

Tehe, leave it to us "stupid users" to break your nice little program in new and exiting ways... ;-) But: THANK YOU! Both things are indeed working now - that brings me one step closes to my automated logbook, which is great!

 

Stefan Ritt wrote:

Concerning your request of editing existing entries by their idea, I agree with Yoshi that you could grab the ID upon the first submission. An alternative is to make a direct search on a logbook. Since this is not implemented in the elog command line tool, you have to use wget for it:

wget "http://localhost:8080/LOGBOOK/?mode=raw&Attribute1=something" -O elog.txt

A problem here is that the username and password are normally transmitted in an encrypted form as cookies by your browser after you logged in. Now you have to convince wget first to log in like

wget "http://localhost:8080/LOGBOOK/?unamee=USER&upassword=PASSWD"--save-cookies cookies.txt

followed by a second call to wget with --load-cookies cookies.txt. I tried that but was not successful since the login procedure above redirects to the elog listing page, and only the cookies set after the redirection were saved in cookies.txt. Maybe you can figure out how to do that. The only way I could get it to work is to supply the encoded password, which I manually obtained from the password file. The URL was then

wget "http://localhost:8080/LOGBOOK/?mode=raw&Attribute1=something&unm=USER&upwd=ENC_PWD" -O elog.txt

I thought about grabbing the ID on first creation. The problem with that is that I really would have to run parallel "databases" - one in elog to keep the information I want plus a second one which maps the elog-IDs to the "real" IDs - and the second one would also have to deal with things like "ID exists", "ID doesn't exist", "ID gets deleted" and so on - just the kind of hassle I want to avoid. But what you suggest with wget will most likely be sufficient. The logbook in question is readable for everyone (only editing/writing requires authentication), so I can search without password hassle. In fact, this will work:

 

wget -q "http://localhost:8080/LOGBOOK/?mode=raw&Attribute1=something" -O -| grep '\$@MID'|awk '{print $2}'

Et voila, I have an ID. This will generate a bit more traffic than a parallel "DB", but I think it will be less susceptible to errors, as all information is kept within the elog logbook at all times. Thanks again for your help - time to do some scripting! :-)

icon4.gif   Options selections wipes locked date entry, posted by T. Ribbrock on Mon Oct 13 15:24:29 2008 elog-bug-test-config-20081013.txt

I have two logbooks running, one for current accounts and one for non-active ones. The idea is to move an entry from one logbook to the other once an account becomes non-active. Both logbooks share some attributes (e.g. the name of the account, its creation date, ...), but both also have some uniqe attributes.

While I was playing with this set-up, I ran into a problem:

  1. Move an existing entry from current to non-active.
    • "Type" and "Status" have options. "Created" and "Archived" are in date format.
    • "Created" and "Type" are supposed to be locked in non-active. This works.
    • "Archived" and "Status" are empty, as they do not exist in current. This also works.
    • Depending on the "Type", only certain of the additional attributes are shown on edit. This works as well.
    • I would also like "Status" to have some influence on how certain other attributes are preset and/or shown. This is where the problem starts...
  2. Edit the entry in current.
    • As expected, "Created" and "Type" are shown as locked.
    • As soon as I change the selector for "State", the whole edit mask is redrawn - and the date shown in "Created" is deleted.

I've been experimenting with this quite a while and as far as can see the following applies:

  • Only date format attributes are affected
  • Only locked attributes seem to be deleted completely
  • If I have a date attribute that is not locked and I set it partially in the edit mask (e.g. only select the month or enter a year), it is also deleted
  • If I have a date attribute that is not locked and I set it completely in the edit mask (i.e. day, month and year), it is not deleted

During the experiments I came up with a stripped down version of the non-active logbook configuration, which does show the bug. It only contains Type, Created, Status, Archived. To make an entry to experiment, you'll have to comment out the "Locked attributes" line, make a new entry (with "Created" date), the uncomment that line.

I hope my description isn't too confusing - please don't hesitate to ask if anything is unclear. I'd be much obliged if you saw a chance to fix this at some point...

Best regards,

Thomas

icon5.gif   "Style" based on two MOptions - possible?, posted by T. Ribbrock on Tue Oct 14 10:29:34 2008 

We have a logbook in which we use two "Status" attributes, both of which are MOptions. What we want to do is have the corresponding line of the list change its colour depending on the combination of those attributes. I have done so successfully using "Style" for a single Options or MOptions or even two Options (using conditionals and a third attribute), but up until now I have no luck with two MOptions. Conditionals do not seem to work with MOptions (the manual only mentions Options and when I tried anyway, it did not work... ) and multiple "Style" statements also do not seem to work. I've tried the following:

MOptions StatusA = Status-A-red, Status-A-orange, Status-A
MOptions StatusB = Status-B-red, Status-B-orange, Status-B

Style StatusA Status-A-red = background-color:red
Style StatusA Status-A-red | Status-A-orange = background-color:red
Style StatusA Status-A-red | Status-A = background-color:red
Style StatusA Status-A-red | Status-A-orange | Status-A = background-color:red
Style StatusA Status-A-orange = background-color:orange
Style StatusA Status-A-orange | Status-A = background-color:orange
Style StatusB Status-B-red = background-color:red
Style StatusB Status-B-red | Status-B-orange = background-color:red
Style StatusB Status-B-red | Status-B = background-color:red
Style StatusB Status-B-red | Status-B-orange | Status-B = background-color:red
Style StatusB Status-B-orange = background-color:orange
Style StatusB Status-B-orange | Status-B = background-color:orange

As far as I can see, the "Style" statement for StatusB only gets evaluated if none of the statements for StatusA matches (i.e. StatusA = Status-A). What I would want to achieve is that any "red" condition in either StatusA or StatusB takes precedence over "orange" and "none" and that "orange" takes precedence over "none".

Is there any solution for this problem short of merging both status attributes into one (which would be very unwieldy, especially, as StatusB is not used at all in some cases)? Any suggestions are most welcome!

Thanks in advance,

Thomas

icon5.gif   (How) can I hide columns in List view?, posted by T. Ribbrock on Mon Oct 20 15:32:19 2008 

Originally, all information about our machines was stored in a spreadsheet with one sheet for the hardware of the machines and one for the software. By now, I've sucessfully moved the software part to an elog logbook and am now looking at transferring the hardware part as well.

As both lists are machine-name based, one of the options would be to merge both lists, as this would place all machine-related info into one logbook. The downside of this is that I get so many columns in list view that the result is quite unwieldy. Hence, I would like to hide some columns - ideally creating a "hardware view" and a "software view".

From the documentation, the only option I could find that seemed suitable was "List conditions". Unfortunately, I do not quite understand from the manual how this is supposed to work, so I'm quite possibly doing something wrong. I've tried this:

; General settings
List conditions = 1

; Attributes
Attributes = Type, Created, StatusA, StatusB, Archived

; Options & Tooltips
Options Type = Type1{10}, Type2{11}

; Conditionals
{10}List display = Edit, Type, Created, Status
{11}List display = Edit, Type, Created, StatusA, StatusB, Archived

but no matter how I set "Type", it does not seem to have any effect on the List display. One thing I don't understand for example is how does elog decide in List view which entry sets the condition? If all entries are set to the same value (in this example e.g. "Type1")? The first entry? Or am I missing something altogether?

Also, if there are alternative ways how I could accomplish my goal, I'd also be most grateful for suggestions.

Thanks in advance,

Thomas

ELOG V3.1.5-3fb85fa6