Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 44 of 806  Not logged in ELOG logo
ID Date Icon Authordown Author Email Category OS ELOG Version Subject
  67761   Thu Jan 22 17:27:47 2015 Question devjoshi868b@gmail.comQuestionAll3.3calculate the value of one attribute depending upon the value of other attribute.

I HAVE A LOGBOOK WHICH KEEPS THE RECORD OF ALL FAULT BOOKED BY DIFFERENT SUBSCRIBER.THIS LOGBOOK HAS THREE ATTRIBUTE DOWNTIME,UPTIME & TOTAL DURATION (DATE &TIME FORMAT) . I WANT TO CALCULATE THE TOTAL DURATION AUTOMATICALLY WHENEVR UPTIME VALUE IS GIVEN AND IF THE UPTIME IS NOT GIVEN IT SHOULD CALCULATE DEPENDING UPON THE SYSTEM PRESENT TIME.PLEAS EXPLAIN IT WITH EXAMPLE.

  67766   Mon Jan 26 15:46:04 2015 Question devjoshi868b@gmail.comRequestAll3.3how to calculate the time

I HAVE A LOGBOOK WHICH KEEPS THE RECORD OF ALL FAULT BOOKED BY DIFFERENT SUBSCRIBER.THIS LOGBOOK HAS THREE ATTRIBUTE DOWNTIME,UPTIME & TOTAL DURATION (DATE &TIME FORMAT) . I WANT TO CALCULATE THE TOTAL DURATION AUTOMATICALLY WHENEVR UPTIME VALUE IS GIVEN AND IF THE UPTIME IS NOT GIVEN IT SHOULD CALCULATE DEPENDING UPON THE SYSTEM PRESENT TIME.PLEAS EXPLAIN IT WITH EXAMPLE.

  67768   Mon Jan 26 19:24:02 2015 Reply devjoshi868b@gmail.comQuestionAll3.3Re: calculate the value of one attribute depending upon the value of other attribute.

I tried that It is not calculating  and it is giving the error "Shell execution not enabled via -x flag ".I started elogd -x from command prompt  it still gives the same error.

Andreas Luedeke wrote:

If you have the following elogd.cfg:

Attributes = START, END, DURATION
subst DURATION = $shell( /usr/local/elog/diff.sh \"$START\" \"$END\")
Show Attributes Edit = START, END

And the shell script /usr/local/elog/diff.sh is:

#!/bin/sh
s1=$(date -d "$1" +%s)
s2=$(date -d "$2" +%s)
d=$(echo "($s2-$s1)/3600"|bc -lq)
printf "%.0f hours" $d

Then DURATION is calculated from START and END in full hours.

It appears that if you define START and END as "datetime", then only the date part would be passed to the script. This may is a bug of elogd: Stefan, have you ever tried?

dev wrote:

I HAVE A LOGBOOK WHICH KEEPS THE RECORD OF ALL FAULT BOOKED BY DIFFERENT SUBSCRIBER.THIS LOGBOOK HAS THREE ATTRIBUTE DOWNTIME,UPTIME & TOTAL DURATION (DATE &TIME FORMAT) . I WANT TO CALCULATE THE TOTAL DURATION AUTOMATICALLY WHENEVR UPTIME VALUE IS GIVEN AND IF THE UPTIME IS NOT GIVEN IT SHOULD CALCULATE DEPENDING UPON THE SYSTEM PRESENT TIME.PLEAS EXPLAIN IT WITH EXAMPLE.

PS: Please do NOT write all capital text in a forum. Thank you!

 

  67773   Tue Jan 27 17:18:17 2015 Reply devjoshi868b@gmail.comQuestionAll3.3Re: calculate the value of one attribute depending upon the value of other attribute.

I am working in window system.Itries using elogd  stop and start  command  but it is always showing it is running.Kindly help  me  thanking you.

Andreas Luedeke wrote:

Yes, I forgot to mention that you need to enable shell script execution by starting the server with "elogd -x".

Before you start elogd from the command line you need to shutdown any running elogd; otherwise the port is blocked and the command line elogd cannot start: "sudo /sbin/service elogd stop"

From Linux you can edit instead /etc/init.d/elogd and add there the option "-x" to the line where "elogd" is started and then restart the service: "sudo /sbin/service elogd restart".

dev wrote:

I tried that It is not calculating  and it is giving the error "Shell execution not enabled via -x flag ".I started elogd -x from command prompt  it still gives the same error.

Andreas Luedeke wrote:

If you have the following elogd.cfg:

Attributes = START, END, DURATION
subst DURATION = $shell( /usr/local/elog/diff.sh \"$START\" \"$END\")
Show Attributes Edit = START, END

And the shell script /usr/local/elog/diff.sh is:

#!/bin/sh
s1=$(date -d "$1" +%s)
s2=$(date -d "$2" +%s)
d=$(echo "($s2-$s1)/3600"|bc -lq)
printf "%.0f hours" $d

Then DURATION is calculated from START and END in full hours.

It appears that if you define START and END as "datetime", then only the date part would be passed to the script. This may is a bug of elogd: Stefan, have you ever tried?

dev wrote:

I HAVE A LOGBOOK WHICH KEEPS THE RECORD OF ALL FAULT BOOKED BY DIFFERENT SUBSCRIBER.THIS LOGBOOK HAS THREE ATTRIBUTE DOWNTIME,UPTIME & TOTAL DURATION (DATE &TIME FORMAT) . I WANT TO CALCULATE THE TOTAL DURATION AUTOMATICALLY WHENEVR UPTIME VALUE IS GIVEN AND IF THE UPTIME IS NOT GIVEN IT SHOULD CALCULATE DEPENDING UPON THE SYSTEM PRESENT TIME.PLEAS EXPLAIN IT WITH EXAMPLE.

PS: Please do NOT write all capital text in a forum. Thank you!

 

 

 

  67776   Wed Jan 28 18:12:53 2015 Question devjoshi868b@gmail.comQuestionWindows3.3enable batch file execution

How to execute  the batch file  in elogd

  67778   Wed Jan 28 18:21:17 2015 Reply devjoshi868b@gmail.comQuestionWindows3.3Re: enable batch file execution

I tried it but still it gives error like Shell execution not enabled via -x flag 

 

Stefan Ritt wrote:

Modify the server start command in the Windows Registry. Or start the elogd server directly in a command window with "elogd -x", after "cd" to the elog installation directory.

dev wrote:

How to enable the batch file execution in elogd

 

 

  67780   Wed Jan 28 19:18:24 2015 Reply devjoshi868b@gmail.comQuestionWindows3.3Re: enable batch file execution

From the command mode i am not able to stop and start  (elogd stop). But i can start/stop from services  .Kindly help  me stopping/starting it from command 

Stefan Ritt wrote:

Stop the old server first, but we told you this already on elog:67770. If you don't follow our suggestions we cannot help you.

dev wrote:

I tried it but still it gives error like Shell execution not enabled via -x flag 

 

Stefan Ritt wrote:

Modify the server start command in the Windows Registry. Or start the elogd server directly in a command window with "elogd -x", after "cd" to the elog installation directory.

dev wrote:

How to enable the batch file execution in elogd

 

 

 

 

  67782   Wed Jan 28 19:50:41 2015 Reply devjoshi868b@gmail.comQuestionWindows3.3Re: enable batch file execution

First of all thanx for your kind help. Kindly help me on the following problem.

I have a logbook which keeps the record of all fault booked by different subscriber.this logbook has three attribute downtime,uptime & total duration (date &time format) . I want to calculate the total duration automatically whenevr uptime value is given and if the uptime is not given it should calculate depending upon the system present time.pleas explain it with example.

thanking you 

Stefan Ritt wrote:

May I kindly ask you to Google how to start/stop a service from the command line.

dev wrote:

From the command mode i am not able to stop and start  (elogd stop). But i can start/stop from services  .Kindly help  me stopping/starting it from command 

Stefan Ritt wrote:

Stop the old server first, but we told you this already on elog:67770. If you don't follow our suggestions we cannot help you.

dev wrote:

I tried it but still it gives error like Shell execution not enabled via -x flag 

 

Stefan Ritt wrote:

Modify the server start command in the Windows Registry. Or start the elogd server directly in a command window with "elogd -x", after "cd" to the elog installation directory.

dev wrote:

How to enable the batch file execution in elogd

 

 

 

 

 

 

ELOG V3.1.5-3fb85fa6