[Xymon] bbnote_editor

Roland Soderstrom Rolands at logicaltech.com.au
Wed Sep 12 00:44:13 CEST 2012


I discovered that last week, it worked somehow but was dependent on old notes.html already created. New ones didn't work.
As I'm not a good perl programmer I hacked a bit more and this one seems to work better, surely more bugs to show up!
( I just sort of just steal code and modify, no clue on how it really works...)

I didn't realize that the cgi actually built the edit notes pages on the fly so I changed the menu sub to edit it.
You have to edit the notes editor page with the menu as well as the notes.html page it creates.
The new sub does this for me at least, please try and report if it works.


-          Roland

From: sholmes42 at gmail.com [mailto:sholmes42 at gmail.com] On Behalf Of Steve Holmes
Sent: Wednesday, 12 September 2012 7:02 AM
To: Roland Soderstrom
Cc: xymon at xymon.com
Subject: Re: [Xymon] bbnote_editor

Ok, I still have trouble with the menus when using this script, but first a few corrections:

I had to remove the string "file:" from the line defining XYMONBODYHEADER and then remove an extra comma in two lines referencing MENUITEMS.

***************
*** 52,63 ****
  }

  sub print_menuitems {
!     $ENV{'XYMONBODYHEADER'}='file:/usr/local/xymon/server/etc/xymonmenu.cfg';
!     open (MENUITEMS, "<$ENV{'XYMONBODYHEADER'}") or &print_error("I can't read from XYMONBODYHEADER");
!     while (<MENUITEMS,>) {
          print;
      }
!     close MENUITEMS,;
  }

  sub print_notesdata {
--- 52,63 ----
  }

  sub print_menuitems {
!     $ENV{'XYMONBODYHEADER'}='/usr/local/xymon/server/etc/xymonmenu.cfg';
!     open (MENUITEMS, "<$ENV{'XYMONBODYHEADER'}") or &print_error("I can't read from $ENV{'XYMONBODYHEADER'}");
!     while (<MENUITEMS>) {
          print;
      }
!     close MENUITEMS;
  }

  sub print_notesdata {


But still, the Views menu doesn't work (none of the other menus are right either). It looks good, but when you select either Main View or All Non-green View the URL that is built is wrong. E.g.:

https://xymonservername/xymon-seccgi/$XYMONSERVERWWWURL/xymon.html

The "xymon-seccgi" shouldn't be there and the $XYMONSERVERWWWURL should be replaced with the actual path component from the variable by the same name.

I.e. for my server it should be:

https://xymonservername/xymon/xymon.html

I've verified that the environment hash is built ok, but have not figured out what I need to do to get the value into the URL for the menu to use.

Has anyone else worked on this?

Thanks,
Steve
On Mon, Sep 3, 2012 at 8:22 PM, Roland Soderstrom <Rolands at logicaltech.com.au<mailto:Rolands at logicaltech.com.au>> wrote:
I solved a problem with the excellent bbnote_edit by Galen Johnson

In 4.3.5 it works fine.
In 4.3.10 the menus doesn't work, I'm guessing it is because the menu javascripts are gone.

A simple change in the bbnote_editor.cgi solved the issue.
I'm not a good perl programmer so I consider this more of a hack...

Included my notes_header for 4.3  (a few typos)
and bbnote_editor.cgi for 4.3


-          Roland

_______________________________________________
Xymon mailing list
Xymon at xymon.com<mailto:Xymon at xymon.com>
http://lists.xymon.com/mailman/listinfo/xymon

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20120911/db5ba2c2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bbnote_editor.cgi
Type: application/octet-stream
Size: 7662 bytes
Desc: bbnote_editor.cgi
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20120911/db5ba2c2/attachment.obj>


More information about the Xymon mailing list