Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 391 of 808  Not logged in ELOG logo
ID Date Icon Author Author Email Categorydown OS ELOG Version Subject
  68170   Wed Oct 28 11:11:27 2015 Reply kenzo Abrahamskenzoabrahams@gmail.comQuestionLinux3.1.1Re: running more then one shell command when new entries is submitted

Hi Andreas

This worked perfectly thank you.

Andreas Luedeke wrote:
As far as I know ELOG is recognising a configuration line as a comment only when it starts with a ';'.
I can assure you that ELOG does not treat the rest of the line as a comment when you use a ';' within a $shell() command: I do it a lot and it works fine. Here's a simple, generic example using the bash:

Preset Author = $shell(if [ $short_name = "Anonym" ] ;then echo $Author;else echo \"$long_name, $Author\";fi)
It adds $long_name to the Author field for non-anonymous entries.

Cheers Andreas

kenzo Abrahams wrote:

If i put the ';' into Execute the rest of the command becomes a comment thats why i was trying to use '&&' instead. If I encapulate the whole command in "" or '' then both commands are executed but the files im trying to write to gets created but no data is piped into it. When I use Execute with one command and pipe its output to a file everything works fine though.

Stefan Ritt wrote:

The command is passed to your shell, and some shells except more than one command. Most Linux shells accept commands separated by ';', which you can try yourself by entering for example: ls *.c; ls*.h

kenzo Abrahams wrote:

Hi

Im just curious is it possible to run more then one command using Execute new = <command> or will i have to run a script to run muliple commands.

I tried using '&&' to seperate more then one command but it seems that the first one only gets executed and the rest are just ignored.

Regards

Kenzo

 

 

 

 

  68171   Thu Oct 29 12:30:43 2015 Question kenzo Abrahamskenzoabrahams@gmail.comQuestionLinux3.1.1propogating messages through logbooks
Hi there

Okay so let me explain what im trying to do. I have a table in a logbook (lets call it home) that the user fills
out. This information in the table is related to other logbooks (8 of them to be exact).
I want to propogate information from the table in the home logbook into the other logbooks. To do this I used
Execute new which runs my scripts. One of the scripts makes a call to the elog
client to submit the message. The problem is that this call to elog client never finishes because its hanging
waiting for the initial submit (one which triggered Execute new) to finish. The documentation
explained that only one submit can be processed at a time so i expected whats happening at the moment.

My question is are there any other ways to do what im trying to do?? In a nutshell how to propogate information
from one logbook to another autonomously.

Regards
Kenzo
  68172   Fri Oct 30 15:52:33 2015 Reply Andreas Luedekeandreas.luedeke@psi.chQuestionLinux3.1.1Re: propogating messages through logbooks
> Hi there
> 
> Okay so let me explain what im trying to do. I have a table in a logbook (lets call it home) that the user fills
> out. This information in the table is related to other logbooks (8 of them to be exact).
> I want to propogate information from the table in the home logbook into the other logbooks. To do this I used
> Execute new which runs my scripts. One of the scripts makes a call to the elog
> client to submit the message. The problem is that this call to elog client never finishes because its hanging
> waiting for the initial submit (one which triggered Execute new) to finish. The documentation
> explained that only one submit can be processed at a time so i expected whats happening at the moment.
> 
> My question is are there any other ways to do what im trying to do?? In a nutshell how to propogate information
> from one logbook to another autonomously.
> 
> Regards
> Kenzo

Hi Kenzo,
I think it would help me to understand your problem, if you would provide a minimal configuration file with two
logbooks.

There is no ELOG internal feature to propagate data from one logbook to another; 
using a shell script is the only method I know.
But you could easily put your script into the background: 
ELOG can handle multiple parallel request, by handling one request after the other.

Kind Regards, Andreas
  68174   Mon Nov 2 07:39:07 2015 Reply kenzo Abrahamskenzoabrahams@gmail.comQuestionLinux3.1.1Re: propogating messages through logbooks
 
> Hi Kenzo,
> I think it would help me to understand your problem, if you would provide a minimal configuration file with two
> logbooks.
> 
> There is no ELOG internal feature to propagate data from one logbook to another; 
> using a shell script is the only method I know.
> But you could easily put your script into the background: 
> ELOG can handle multiple parallel request, by handling one request after the other.
> 
> Kind Regards, Andreas

Hi Andreas

Im using python to do the scripting. Everything works fine until it comes to submitting the entry to my logbook.
The extractTable.py file is the one running the command to submit to elog.
I see now that im starting a subprocess in my python script (subprocess.call) and thats why its not finishing.
Could you perhaps suggest how I would go about doing this by putting my scripts in the
background? I might have to look at multiprocessing in python as well. The reason im using python is because im
doing alot of file processing as well. I do have to add that this method works perfectly when i just run the python
on its own. As soon as i run it by submiting an elog entrie from the browser it hangs on the subprocess.call method.

Regards, Kenzo
Attachment 1: elogd.cfg
[global]
Group Ithemba = Configuration, Maintenance
Group Maintenance = C1
port = 8080

[Configuration]
Theme = default
Comment = Current configuration of detectors
Attributes = Author, Subject
Preset Subject = Current Configuration
Required Attributes = Author
Locked Attributes = Author, Subject
Page Title = ELOG - $subject
Reverse sort = 1
Quick filter = Date
Execute new = $shell(echo "$message id" &> /usr/local/elog/logbooks/ID.txt; python /usr/local/elog/logbooks/lookupConfig.py; python /usr/local/elog/logbooks/extractTable.py)

[C1]
theme = default
Comment = Maintenance information for clover detector C1
Attributes = Author, Subject, Type
Options Type = Defects, Routine, Problem Fixed, Maintenance
Preset Author = $long_name 
Required Attributes = Author
Locked Attributes = Author
Page Title = ELOG - $subject
Reverse sort = 1
Quick filter = Date

Attachment 2: extractTable.py
#!/usr/bin/python

from bs4 import BeautifulSoup
import sys
import re
import time
import csv
import subprocess

#time.sleep(2)

counter = 0
DetectorNum = 1
soup = BeautifulSoup(open('/usr/local/elog/logbooks/Table.html'), 'html5lib')

for table in soup.find_all('table'):
	for row in table.find_all('tr'):
		col = row.find_all('td')

		Xia = col[0].string
		module = col[1].string
		channel = col[2].string
		name = col[3].string
		arrayPos = col[4].string
		panel = col[5].string

		if counter == 0:
			titleList = (str(Xia), str(module), str(channel), str(name), str(arrayPos), str(panel))
			counter = counter + 1	
		else:	
			record = (str(Xia), str(module), str(channel), str(name), str(arrayPos), str(panel))

			file = open('/usr/local/elog/logbooks/tableData', 'w')
			for i in range(len(titleList)):
				file.write(str(titleList[i])+" = "+str(record[i])+"\n")
			file.close()

			DetName = "C"+str(DetectorNum)

			subprocess.call(["elog", "-h", "localhost", "-p", "8080", "-l", DetName, "-u", "System", "password", "-a", "Author=System", "-a", "Subject=\"testing the auto writing of detectors\"", "-m", "/usr/local/elog/logbooks/tableData"])
			counter = counter + 1
			DetectorNum = DetectorNum + 1
  68175   Mon Nov 2 08:37:06 2015 Reply kenzo Abrahamskenzoabrahams@gmail.comQuestionLinux3.1.1Re: propogating messages through logbooks
>  
> > Hi Kenzo,
> > I think it would help me to understand your problem, if you would provide a minimal configuration file with two
> > logbooks.
> > 
> > There is no ELOG internal feature to propagate data from one logbook to another; 
> > using a shell script is the only method I know.
> > But you could easily put your script into the background: 
> > ELOG can handle multiple parallel request, by handling one request after the other.
> > 
> > Kind Regards, Andreas
> 
> Hi Andreas
> 
> Im using python to do the scripting. Everything works fine until it comes to submitting the entry to my logbook.
> The extractTable.py file is the one running the command to submit to elog.
> I see now that im starting a subprocess in my python script (subprocess.call) and thats why its not finishing.
> Could you perhaps suggest how I would go about doing this by putting my scripts in the
> background? I might have to look at multiprocessing in python as well. The reason im using python is because im
> doing alot of file processing as well. I do have to add that this method works perfectly when i just run the python
> on its own. As soon as i run it by submiting an elog entrie from the browser it hangs on the subprocess.call method.
> 
> Regards, Kenzo

Hi Andreas

I sorted my problem out, I had to use threading in python such that I can time the submissions to the elog server.
Everything works fine now. Thank you for the assistance.

Regards
Kenzo
  68178   Wed Nov 4 14:40:39 2015 Reply Andreas Luedekeandreas.luedeke@psi.chQuestionLinux2.9.2Re: WYSIWYG editor for Elog not working in Debian Jessie
Hi Nicola,
this appears to be a particular problem of the specific (outdated) ELOG debian package.
But you could just download the FCKeditor directly and install it to the proposed location "/usr/share/fckeditor".
Or you download ELOG 3.1.1 and give it a try to install it with the makefile.
Cheers, Andreas
Nicola wrote:

I suspect that this might be a Debian packaging issue; however no one replied to my help request on the Debian forums so I try posting the question also here. I insatlled Elog on my Debian Jessie machine, I can open it with a browser but when entering a new post just a simple plain text editing box is shown instead of the WYSIWYG editor, and no drag and drop area for attachments is shown. When I start the elog service with "systemctl start elog" I get this suspect message in the journal: "FCKedit NOT detected". Indeed, I see that the elog installation creates a symlink which I guess is supposed to point to the fckeditor installation, which nevertheless is missing:

root@static-3-080:/usr/share/elog/scripts# ll fckeditor
lrwxrwxrwx 1 root root 15 Oct 25  2014 fckeditor -> ../../fckeditor
root@static-3-080:/usr/share/elog/scripts# ll ../../fckeditor
ls: cannot access ../../fckeditor: No such file or directory

Is this a Deban misconfiguration or a bug in Elog? thanks

 

  Draft   Fri Nov 6 15:45:33 2015 Reply Nicolanicolamori@aol.comQuestionLinux2.9.2Re: WYSIWYG editor for Elog not working in Debian Jessie
<p>Hi Andreas, I opted for installing FCKeditor rather than Elog, since the debian package, even if outdated and broken, has some goodies like a systemd unit which is very handy for managing the daemon. I found FCKeditor 2.6.11 on SorceForge (after a long search, seems that CKeditor almost made his parent disappear from the web), unpacked it in the proper folder and now when I edit a page I can use the WYSIWYG editor. There are just two minor issues: the first is that no drop area for the attachments is shown (I had it on my old Debian 6 server) and that he toolbar of the editor has an ugly &quot;Windows 95&quot; look. This is a screenshot:</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<table align="center" cellspacing="1" style="border:1px solid #486090; width:98%">
<tbody>
<tr>
<td style="background-color:#486090">Andreas Luedeke wrote:</td>
</tr>
<tr>
<td style="background-color:#FFFFB0">
<div>Hi Nicola,</div>

<div>this appears to be a particular problem of the specific (outdated) ELOG debian package.</div>

<div>But you could just download the FCKeditor directly and install it to the proposed location &quot;/usr/share/fckeditor&quot;.</div>

<div>Or you download ELOG 3.1.1 and give it a try to install it with the makefile.</div>

<div>Cheers, Andreas</div>

<table align="center" cellspacing="1" style="border:1px solid #486090; width:98%">
<tbody>
<tr>
<td style="background-color:#486090">Nicola wrote:</td>
</tr>
<tr>
<td style="background-color:#FFFFB0">
<p>I suspect that this might be a Debian packaging issue; however no one replied to my <a href="http://forums.debian.net/viewtopic.php?f=5&amp;t=125320">help request</a> on the Debian forums so I try posting the question also here. I insatlled Elog on my Debian Jessie machine, I can open it with a browser but when entering a new post just a simple plain text editing box is shown instead of the WYSIWYG editor, and no drag and drop area for attachments is shown. When I start the elog service with &quot;systemctl start elog&quot; I get this suspect message in the journal: &quot;FCKedit NOT detected&quot;. Indeed, I see that the elog installation creates a symlink which I guess is supposed to point to the fckeditor installation, which nevertheless is missing:</p>

<blockquote>
<p><code>root@static-3-080:/usr/share/elog/scripts# ll fckeditor<br />
lrwxrwxrwx 1 root root 15 Oct 25&nbsp; 2014 fckeditor -&gt; ../../fckeditor<br />
root@static-3-080:/usr/share/elog/scripts# ll ../../fckeditor<br />
ls: cannot access ../../fckeditor: No such file or directory</code></p>
</blockquote>

<p>Is this a Deban misconfiguration or a bug in Elog? thanks</p>
</td>
</tr>
</tbody>
</table>

<p>&nbsp;</p>
</td>
</tr>
</tbody>
</table>

<p>&nbsp;</p>
  68181   Fri Nov 6 15:52:30 2015 Reply Nicolanicolamori@aol.comQuestionLinux2.9.2Re: WYSIWYG editor for Elog not working in Debian Jessie

Hi Andreas, I opted for the first solution since the Debian package, although outdated and broken, has some goodies like a systemd unit for managing the daemon which is very handy. I downloaded FCKeditor 2.6.11 from SourceForge (after a long search, seems that CKeditor made its parent almost disappear from the web), unpacked it in the proper folder and not the WYSIWYG editor works. I have just a couple of minor issues: there is no attachment drop area (I had it in my old Debian 6 server) and the editor toolbar has an ugly "Windows 95" look; see the attached image. I can live with these problems but if the can be easily fixed then obviously I would do that, can you give me any hint? Thank you very much.

Andreas Luedeke wrote:
Hi Nicola,
this appears to be a particular problem of the specific (outdated) ELOG debian package.
But you could just download the FCKeditor directly and install it to the proposed location "/usr/share/fckeditor".
Or you download ELOG 3.1.1 and give it a try to install it with the makefile.
Cheers, Andreas
Nicola wrote:

I suspect that this might be a Debian packaging issue; however no one replied to my help request on the Debian forums so I try posting the question also here. I insatlled Elog on my Debian Jessie machine, I can open it with a browser but when entering a new post just a simple plain text editing box is shown instead of the WYSIWYG editor, and no drag and drop area for attachments is shown. When I start the elog service with "systemctl start elog" I get this suspect message in the journal: "FCKedit NOT detected". Indeed, I see that the elog installation creates a symlink which I guess is supposed to point to the fckeditor installation, which nevertheless is missing:

root@static-3-080:/usr/share/elog/scripts# ll fckeditor
lrwxrwxrwx 1 root root 15 Oct 25  2014 fckeditor -> ../../fckeditor
root@static-3-080:/usr/share/elog/scripts# ll ../../fckeditor
ls: cannot access ../../fckeditor: No such file or directory

Is this a Deban misconfiguration or a bug in Elog? thanks

 

 

Attachment 1: elog-debian8.jpeg
elog-debian8.jpeg
ELOG V3.1.5-3fb85fa6