Xymon Mailing List Archive search

Remedy Ticketing

5 messages in this thread

list Matthew Epp · Thu, 24 Aug 2006 17:11:51 -0400 ·
I have an existing Remedy ticket generation system for Big Brother that I'm
trying to convert to Hobbit. Basically, I had added some code to dohostsvc.c
for an additional button next to HISTORY:

 
sprintf(dataline,"<td><FORM ACTION=\"%s/bb-ticket.sh\"><INPUT TYPE=SUBMIT
VALUE=\"Open Ticket\"><INPUT TYPE=HIDDEN NAME=\"ACKFILE\"
VALUE=\"%s\"><INPUT TYPE=HIDDEN NAME=\"TIMEBUF\"
VALUE=\"%s\"></FORM></td>\n",cgibinurl,filename,logtime);

                strcat(hostsvcdata,dataline);

 
This passed the form data to a shell cgi script, and from there I was able
to grab whatever data I needed from the history logs. If someone even wanted
to open a ticket on a historical event, they could, because the TIMEBUF
always pointed to the correct event log.

 
Now, I see the part in htmllog.c that creates the historybutton(), but I
can't see where I might be able to grab the TIMEBUF from. I tried an
xgetenv("TIMEBUF") but no luck. Any other way I can get the timestamp?
list Henrik Størner · Thu, 24 Aug 2006 23:31:39 +0200 ·
quoted from Matthew Epp
On Thu, Aug 24, 2006 at 05:11:51PM -0400, Epp, Matthew Contractor PEO EIS AKO wrote:
I have an existing Remedy ticket generation system for Big Brother that I'm
trying to convert to Hobbit. Basically, I had added some code to dohostsvc.c
for an additional button next to HISTORY:
[snip]
to grab whatever data I needed from the history logs. If someone even wanted
to open a ticket on a historical event, they could, because the TIMEBUF
always pointed to the correct event log.

Now, I see the part in htmllog.c that creates the historybutton(), but I
can't see where I might be able to grab the TIMEBUF from. I tried an
xgetenv("TIMEBUF") but no luck. Any other way I can get the timestamp?
I'm slightly confused about what you did. The *current* status page
(which is where you have a "History" button) doesn't have a "timebuf"
value, because it's just the current status - and it might not be logged
in the historical logs directory.

On the other hand, a *historical* status log page doesn't have a
"History" button because ... well, you're already looking at history.

If you can work it out yourself, then you probably need the "logtime"
parameter for the generate_html_log() routine. This has the Unix
timestamp of the log entry. If you need to convert the timestamp into
the filename format used by the historical logs, "histlogtime(timestamp);" 
will return a string with the correct formatting of the timestamp.


Regards,
Henrik
list T.J. Yang · Fri, 25 Aug 2006 08:00:24 -0500 ·
Hi, Matthew


I used to be able to open remedy ticket when alert (conn) occurs on a bb 
test server.
Your enhancement is very useful to allow one open remedy ticket from hobbit 
web page.

Would you like to contribute your work on hobbit wiki docs ?

http://en.wikibooks.org/wiki/System_Monitoring_with_Hobbit/Administration_Guide#Hobbit_and_Rememdy_Ticket_System


T.J. Yang
quoted from Henrik Størner

From: "Epp, Matthew Contractor PEO EIS AKO" <user-c07bdcff406c@xymon.invalid>
Reply-To: user-ae9b8668bcde@xymon.invalid
To: "'user-ae9b8668bcde@xymon.invalid'" <user-ae9b8668bcde@xymon.invalid>
Subject: [hobbit] Remedy Ticketing
Date: Thu, 24 Aug 2006 17:11:51 -0400

I have an existing Remedy ticket generation system for Big Brother that I'm
trying to convert to Hobbit. Basically, I had added some code to 
dohostsvc.c
for an additional button next to HISTORY:


sprintf(dataline,"<td><FORM ACTION=\"%s/bb-ticket.sh\"><INPUT TYPE=SUBMIT
VALUE=\"Open Ticket\"><INPUT TYPE=HIDDEN NAME=\"ACKFILE\"
VALUE=\"%s\"><INPUT TYPE=HIDDEN NAME=\"TIMEBUF\"
VALUE=\"%s\"></FORM></td>\n",cgibinurl,filename,logtime);

                strcat(hostsvcdata,dataline);


This passed the form data to a shell cgi script, and from there I was able
to grab whatever data I needed from the history logs. If someone even 
wanted
to open a ticket on a historical event, they could, because the TIMEBUF
always pointed to the correct event log.


Now, I see the part in htmllog.c that creates the historybutton(), but I
can't see where I might be able to grab the TIMEBUF from. I tried an
xgetenv("TIMEBUF") but no luck. Any other way I can get the timestamp?
list Matthew Epp · Fri, 25 Aug 2006 13:17:22 -0400 ·
quoted from Henrik Størner
I'm slightly confused about what you did. The *current* status page
(which is where you have a "History" button) doesn't have a "timebuf"
value, because it's just the current status - and it might not be logged
in the historical logs directory.
In the old Big Brother system, $BBVAR/logs contained a file for every
current status page. So, in the dohostsvc.c I did:

logtime = (char *) getenv("LOGTIME");

Then the cgi script checked to see if it was a current page or a historical
one:  ($TIMEBUF is the value of logtime passed to the cgi script) 

    if [ "$TIMEBUF" != "LOGTIME_not_set" ]; then
 
      HOSTLOG=`echo $HOST | $SED 's/,/_/g'`
 
      # get the color of the status from the status file
      set `$CAT "$BBHISTLOGS/$HOSTLOG/$SERVICE/$TIMEBUF" | $HEAD -1`
/dev/null 2>&1
      BKG="$1"
      # Grab the status page from histlogs
      ALERTDATA=`$CAT $BBHISTLOGS/$HOSTLOG/$SERVICE/$TIMEBUF`
    else
      # Grab the current status page
      set `$CAT "$BBLOGS/$HOSTSVC" | $HEAD -1` >/dev/null 2>&1
      BKG="$1"
 
      ALERTDATA=`$CAT $BBLOGS/$HOSTSVC`
    fi
quoted from Henrik Størner
 
On the other hand, a *historical* status log page doesn't have a
"History" button because ... well, you're already looking at history.

If you can work it out yourself, then you probably need the "logtime"
parameter for the generate_html_log() routine. This has the Unix
timestamp of the log entry. If you need to convert the timestamp into
the filename format used by the historical logs, "histlogtime(timestamp);"
will return a string with the correct formatting of the timestamp.
Does a current status page get saved anywhere to a file in Hobbit like Big
Brother did? I need some way to pass the data to the cgi script for parsing.
list Greg L Hubbard · Fri, 25 Aug 2006 12:58:42 -0500 ·
Matt, I think that is a configuration option.  One of the Hobbit
improvements was moving the history stuff into memory and out of flat
files.  But I think I remember an option that would make Hobbit write
out the history logs like BB did.

GLH 

-----Original Message-----
From: Epp, Matthew Contractor PEO EIS AKO
[mailto:user-c07bdcff406c@xymon.invalid] 
Sent: Friday, August 25, 2006 12:17 PM
To: 'user-ae9b8668bcde@xymon.invalid'
Subject: RE: [hobbit] Remedy Ticketing
quoted from Matthew Epp
I'm slightly confused about what you did. The *current* status page 
(which is where you have a "History" button) doesn't have a "timebuf"
value, because it's just the current status - and it might not be 
logged in the historical logs directory.
In the old Big Brother system, $BBVAR/logs contained a file for every
current status page. So, in the dohostsvc.c I did:

logtime = (char *) getenv("LOGTIME");

Then the cgi script checked to see if it was a current page or a
historical
one:  ($TIMEBUF is the value of logtime passed to the cgi script) 

    if [ "$TIMEBUF" != "LOGTIME_not_set" ]; then
 
      HOSTLOG=`echo $HOST | $SED 's/,/_/g'`
 
      # get the color of the status from the status file
      set `$CAT "$BBHISTLOGS/$HOSTLOG/$SERVICE/$TIMEBUF" | $HEAD -1`
/dev/null 2>&1
      BKG="$1"
      # Grab the status page from histlogs
      ALERTDATA=`$CAT $BBHISTLOGS/$HOSTLOG/$SERVICE/$TIMEBUF`
    else
      # Grab the current status page
      set `$CAT "$BBLOGS/$HOSTSVC" | $HEAD -1` >/dev/null 2>&1
      BKG="$1"
 
      ALERTDATA=`$CAT $BBLOGS/$HOSTSVC`
    fi
 
On the other hand, a *historical* status log page doesn't have a 
"History" button because ... well, you're already looking at history.

If you can work it out yourself, then you probably need the "logtime"
parameter for the generate_html_log() routine. This has the Unix 
timestamp of the log entry. If you need to convert the timestamp into 
the filename format used by the historical logs,
"histlogtime(timestamp);"
will return a string with the correct formatting of the timestamp.
Does a current status page get saved anywhere to a file in Hobbit like
Big Brother did? I need some way to pass the data to the cgi script for
parsing.