Xymon Mailing List Archive search

Possible bugs

10 messages in this thread

list David Stuffle · Thu, 7 Apr 2005 16:42:00 -0500 ·
Just a few things that may be bugs:
1. If I define an alert with DURATION>90, the info column shows it as "1h"
instead of "90min".

2. Hobbit-alerts.cfg says that you can do HOST=%www.* to match anything
*starting* with www, but I'm seeing that it actually matches *anything* with
www in it.  I had to do HOST=%^www.*.  I guess if I knew Perl regex better I
would have realized this in the first place.

3. On the bb2 page, in the list of events in the past xxx minutes, if a test
goes from "red/yellow/green" to blue, and you click on the blue image, it
doesn't show the blue status page.  It shows the status of what it changed
from.  All other colors seem to work fine, just blue does this.

Small issues, just wanted to point them out.

Hobbit is doing great so far...

~~~~~~~~~~~~~~
David Stuffle      
Delta Faucet Company


This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the system manager.
Please note that any views or opinions presented in this email are solely
those of the author and do not necessarily represent those of the company.
Finally, the recipient should check this email and any attachments for the
presence of viruses. The company accepts no liability for any damage caused
by any virus transmitted by this email.
list Henrik Størner · Sun, 10 Apr 2005 14:59:11 +0200 ·
quoted from David Stuffle
On Thu, Apr 07, 2005 at 04:42:00PM -0500, Stuffle, David wrote:
Just a few things that may be bugs:
1. If I define an alert with DURATION>90, the info column shows it as "1h"
instead of "90min".
Indeed, there were some missing parenthesis and stuff in the routine
that did this string formatting. Fixed with the first of the attached
patches.
quoted from David Stuffle

2. Hobbit-alerts.cfg says that you can do HOST=%www.* to match anything
*starting* with www, but I'm seeing that it actually matches *anything* with
www in it.  I had to do HOST=%^www.*.  I guess if I knew Perl regex better I
would have realized this in the first place.
Me too :-) I've corrected to sample regex to match the description.
quoted from David Stuffle

3. On the bb2 page, in the list of events in the past xxx minutes, if a test
goes from "red/yellow/green" to blue, and you click on the blue image, it
doesn't show the blue status page.  It shows the status of what it changed
from.  All other colors seem to work fine, just blue does this.
After digging around for some time, I found out that this is really an
issue that happens with the Hobbit-internal status changes (blue and
purple) - you'll also see it if you go via the "History" button and
select a blue or purple log.

When a status goes blue or purple, this only changes the color stored
internally in Hobbit, it doesn't change the actual status message text
that is stored in the historical logfile (which includes the
color-text). So all of the Hobbit-maintained event-logs will show the
correct color, but the historical logfile does not. So I fixed this in
the module that saves the historical log - this means that it will not
have any effect on the previous historical logs, only on the ones that
are processed after you install the patch.


Regards,
Henrik
-------------- next part --------------
--- lib/timefunc.c	2005/03/27 06:56:44	1.18
+++ lib/timefunc.c	2005/04/10 12:04:24
@@ -345,32 +345,42 @@
 
 char *durationstring(time_t secs)
 {
+#define ONE_WEEK   (7*24*60*60)
+#define ONE_DAY    (24*60*60)
+#define ONE_HOUR   (60*60)
+#define ONE_MINUTE (60)
• static char result[50];
 	char *p = result;
 	time_t v = secs;
+	int n;
 
 	if (secs == 0) return "-";
 
 	*result = '\0';
 
-	if (v >= 7*24*60*60) {
-		p += sprintf(p, "%dw ", (int)(v / (7*24*60*60)));
-		v = (v % 7*24*60*60);
+	if (v >= ONE_WEEK) {
+		n = (int) (v / ONE_WEEK);
+		p += sprintf(p, "%dw ", n);
+		v -= (n * ONE_WEEK);
 	}
 
-	if (v >= 24*60*60) {
-		p += sprintf(p, "%dd ", (int)(v / (24*60*60)));
-		v = (v % 24*60*60);
+	if (v >= ONE_DAY) {
+		n = (int) (v / ONE_DAY);
+		p += sprintf(p, "%dd ", n);
+		v -= (n * ONE_DAY);
 	}
 
-	if (v >= 60*60) {
-		p += sprintf(p, "%dh ", (int)(v / (60*60)));
-		v = (v % 60*60);
+	if (v >= ONE_HOUR) {
+		n = (int) (v / ONE_HOUR);
+		p += sprintf(p, "%dh ", n);
+		v -= (n * ONE_HOUR);
 	}
 
-	if (v >= 60) {
-		p += sprintf(p, "%dm ", (int)(v / 60));
-		v = (v % 60);
+	if (v >= ONE_MINUTE) {
+		n = (int) (v / ONE_MINUTE);
+		p += sprintf(p, "%dm ", n);
+		v -= (n * ONE_MINUTE);
 	}
 
 	if (v > 0) {
-------------- next part --------------
--- hobbitd/hobbitd_history.c	2005/03/25 21:13:41	1.33
+++ hobbitd/hobbitd_history.c	2005/04/10 12:47:40
@@ -174,6 +174,20 @@
 
 				histlogfd = fopen(fname, "w");
 				if (histlogfd) {
+					/*
+					 * When a host gets disabled or goes purple, the status
+					 * message data is not changed - so it will include a
+					 * wrong color as the first word of the message.
+					 * Therefore we need to fixup this so it matches the
+					 * newcolor value.
+					 */
+					int txtcolor = parse_color(statusdata);
• +					if (txtcolor != -1) {
+						fprintf(histlogfd, "%s", colorname(newcolor));
+						statusdata += strlen(colorname(txtcolor));
+					}
• fwrite(statusdata, strlen(statusdata), 1, histlogfd);
 					fprintf(histlogfd, "Status unchanged in 0.00 minutes\n");
 					fprintf(histlogfd, "Message received from %s\n", items[2]);
list Wim de Houwer · Sun, 10 Apr 2005 15:06:26 +0200 ·
 
Henrik,

Would it be possible to release a patch including all changes since
4.0.1 ?

Cheers,

Wim
list Henrik Størner · Sun, 10 Apr 2005 15:16:38 +0200 ·
quoted from Wim de Houwer
On Sun, Apr 10, 2005 at 03:06:26PM +0200, Wim De Houwer wrote:
 
Would it be possible to release a patch including all changes since
4.0.1 ?
Yes, I do intend to release a 4.0.2 version with all of these bugfixes
later today. I'm just working my way through the e-mails and making
sure everything that's been reported so far is under control.


Regards,
Henrik
list Lars Ebeling · Sun, 10 Apr 2005 17:24:57 +0200 (CEST) ·
quoted from Henrik Størner
Would it be possible to release a patch including
all changes since
4.0.1 ?

Cheers, 
I have been thinking the same
Regards
Lars

Hobbithobbyist

"If you run UNIX and you don't have a UPS, you should see a psychiatrist...."
--Byte Magazine (years ago)
list Kolbjørn Barmen · Sat, 6 May 2006 22:24:35 +0200 (CEST) ·
I have a handfull of issues (IT jargon for "problems") with Hobbit that
I'm not sure whether are bugs or just misconfigurations on my part:


* Menu: Administration -> Find
  No matter what host I search for, the resulting page claims the machine
  location is "Top page" - I wonder, could this be so because I use alternate
  pages for all hosts?

* The Help-menu assumes that hobbit-URL is /hobbit, which is not the case
  for me at least, so I put an alias for /hobbit/ in my apache config.

* Missing manpages:
  /hobbit/help/manpages/man1/hobbit-confreport.cgi.1.html
  /hobbit/help/manpages/man1/hobbit-statusreport.cgi.1.html
  /hobbit/help/manpages/man1/hobbit-ackinfo.cgi.1.html
  /hobbit/help/manpages/man1/hobbit-nkview.cgi.1.html
  /hobbit/help/manpages/man1/hobbit-nkedit.cgi.8.html
  (the latter should probably be in man8 anyhow, I guess)

* I'm probably stupid or lazy, but I cant make any sense of the NK
  editor, nothing happens when I try to use it, and the man pages are
  missing. My /etc/hobbit/hobbit-nkview.cfg exists and is writeable for
  the webserver, the search button gives no results, and the apache log
  doesnt say much either. Any tip?

-- 
Kolbjørn Barmen
UNINETT Driftsenter
list Kolbjørn Barmen · Sun, 7 May 2006 00:23:04 +0200 (CEST) ·
quoted from Kolbjørn Barmen
On Sat, 6 May 2006, Kolbjørn Barmen wrote:
I have a handfull of issues (IT jargon for "problems") with Hobbit that
I'm not sure whether are bugs or just misconfigurations on my part:


* Menu: Administration -> Find
  No matter what host I search for, the resulting page claims the machine
  location is "Top page" - I wonder, could this be so because I use alternate
  pages for all hosts?
I forgot one that might be related:

* In hobbit-clients.cfg it says I can use PAGE/EXPAGE but I never got that
  working - again I wonder if this is due to me using alternate pages.
quoted from Kolbjørn Barmen
* The Help-menu assumes that hobbit-URL is /hobbit, which is not the case
  for me at least, so I put an alias for /hobbit/ in my apache config.

* Missing manpages:
  /hobbit/help/manpages/man1/hobbit-confreport.cgi.1.html
  /hobbit/help/manpages/man1/hobbit-statusreport.cgi.1.html
  /hobbit/help/manpages/man1/hobbit-ackinfo.cgi.1.html
  /hobbit/help/manpages/man1/hobbit-nkview.cgi.1.html
  /hobbit/help/manpages/man1/hobbit-nkedit.cgi.8.html
  (the latter should probably be in man8 anyhow, I guess)

* I'm probably stupid or lazy, but I cant make any sense of the NK
  editor, nothing happens when I try to use it, and the man pages are
  missing. My /etc/hobbit/hobbit-nkview.cfg exists and is writeable for
  the webserver, the search button gives no results, and the apache log
  doesnt say much either. Any tip?
-- 
Kolbjørn Barmen
UNINETT Driftsenter
list Henrik Størner · Tue, 9 May 2006 12:41:37 +0200 ·
quoted from Kolbjørn Barmen
On Sat, May 06, 2006 at 10:24:35PM +0200, Kolbj?rn Barmen wrote:
I have a handfull of issues (IT jargon for "problems") with Hobbit that
I'm not sure whether are bugs or just misconfigurations on my part:

* Menu: Administration -> Find
  No matter what host I search for, the resulting page claims the machine
  location is "Top page" - I wonder, could this be so because I use alternate
  pages for all hosts?
It is. The current "alternate page" system is a rather ugly hack I did
for Big Brother back in the days when Hobbit was just generating some
webpages through the bbgen tool - it really just does a dynamic re-write
of the bb-hosts file when it is loaded into bbgen for generating the 
overview web pages.

You'll probably also see the wrong location on the "info" status page
for your hosts.

Hobbit has never really been aware that a host can appear on different
pages, depending on the page-set you use. I need to implement that, but
it will require adding the page-set as a parameter for all of the
dynamically generated webpages.
quoted from Kolbjørn Barmen
* The Help-menu assumes that hobbit-URL is /hobbit, which is not the case
  for me at least, so I put an alias for /hobbit/ in my apache config.
Hmm - it shouldn't. The URL for the help system is configured into the
menu_items.js file when you build Hobbit. Perhaps you configured it for
/hobbit/ the first time ? Since this file is end-user configurable, it
will not be overwritten when you upgrade or re-install Hobbit.
quoted from Kolbjørn Barmen
* Missing manpages:
  /hobbit/help/manpages/man1/hobbit-confreport.cgi.1.html
  /hobbit/help/manpages/man1/hobbit-statusreport.cgi.1.html
  /hobbit/help/manpages/man1/hobbit-ackinfo.cgi.1.html
  /hobbit/help/manpages/man1/hobbit-nkview.cgi.1.html
  /hobbit/help/manpages/man1/hobbit-nkedit.cgi.8.html
  (the latter should probably be in man8 anyhow, I guess)
Yep, these are on my list of missing docs.
quoted from Kolbjørn Barmen
* I'm probably stupid or lazy, but I cant make any sense of the NK
  editor, nothing happens when I try to use it, and the man pages are
  missing. My /etc/hobbit/hobbit-nkview.cfg exists and is writeable for
  the webserver, the search button gives no results, and the apache log
  doesnt say much either. Any tip?
I'll add some examples of how to use it in the docs. Probably as an HTML 
document with some screen-shots.


Regards,
Henrik
list Henrik Størner · Tue, 9 May 2006 12:44:46 +0200 ·
quoted from Kolbjørn Barmen
On Sun, May 07, 2006 at 12:23:04AM +0200, Kolbj?rn Barmen wrote:
* In hobbit-clients.cfg it says I can use PAGE/EXPAGE but I never got that
  working - again I wonder if this is due to me using alternate pages.
It is.


Regards,
Henrik
list Kolbjørn Barmen · Mon, 15 May 2006 10:40:58 +0200 (CEST) ·
quoted from Henrik Størner
On Tue, 9 May 2006, Henrik Stoerner wrote:
* Menu: Administration -> Find No matter what host I search for, the
resulting page claims the machine location is "Top page" - I wonder,
could this be so because I use alternate pages for all hosts?
It is. The current "alternate page" system is a rather ugly hack I did
for Big Brother back in the days when Hobbit was just generating some
webpages through the bbgen tool - it really just does a dynamic re-write
of the bb-hosts file when it is loaded into bbgen for generating the
overview web pages.

You'll probably also see the wrong location on the "info" status page
for your hosts.
Yes.
quoted from Henrik Størner
Hobbit has never really been aware that a host can appear on different
pages, depending on the page-set you use. I need to implement that, but
it will require adding the page-set as a parameter for all of the
dynamically generated webpages.
OK, I see.

I guess there are too many issues with using alternate pages that I'll
drop using them for now, and rather use two installations or even two
machines.
quoted from Henrik Størner
* The Help-menu assumes that hobbit-URL is /hobbit, which is not the
case for me at least, so I put an alias for /hobbit/ in my apache
config.
Hmm - it shouldn't. The URL for the help system is configured into the
menu_items.js file when you build Hobbit. Perhaps you configured it for
/hobbit/ the first time ? Since this file is end-user configurable, it
will not be overwritten when you upgrade or re-install Hobbit.
I installed the debian package from 
http://www.hswn.dk/hobbitsw/hobbit-client_4.2-alfa-20060423_i386.deb

I did find the menu_items.js and edited it (and added some more shortcuts
that are usefull for us), so no problem :)
quoted from Henrik Størner
* Missing manpages:
  /hobbit/help/manpages/man1/hobbit-confreport.cgi.1.html
  /hobbit/help/manpages/man1/hobbit-statusreport.cgi.1.html
  /hobbit/help/manpages/man1/hobbit-ackinfo.cgi.1.html
  /hobbit/help/manpages/man1/hobbit-nkview.cgi.1.html
  /hobbit/help/manpages/man1/hobbit-nkedit.cgi.8.html
  (the latter should probably be in man8 anyhow, I guess)
Yep, these are on my list of missing docs.
OK :)
quoted from Henrik Størner
* I'm probably stupid or lazy, but I cant make any sense of the NK
  editor, nothing happens when I try to use it, and the man pages are
  missing. My /etc/hobbit/hobbit-nkview.cfg exists and is writeable for
  the webserver, the search button gives no results, and the apache log
  doesnt say much either. Any tip?
I'll add some examples of how to use it in the docs. Probably as an HTML 
document with some screen-shots.
Great!

-- 
Kolbjørn Barmen
UNINETT Driftsenter