NKedit and Instructions
Epp, Matthew Contractor PEO EIS AKO
matthew.epp at us.army.mil
Fri Jul 21 01:09:26 CEST 2006
Greetings! We've been using Big Brother in our datacenter here for over 5
years now, and I've been testing out Hobbit for a few weeks now, planning to
eventually migrate to it. One of the things I'm trying to accomplish before
moving fully to Hobbit is to integrate some of the customizations I've made
to BB.
The one feature I'm focusing on right now is similar to the "Instructions"
section handled by NKedit. In my custom BB, I edited a section of
dohostsvc.c to read in files containing plain text or html. This content
gets placed at the bottom of any page generated from bb-dohostsvc.sh.
Basically, a file called comments.conf resides in $BBHOME/www/comments/ and
looks like this:
----[cut]----
# This is the configuration file for the Special Instructions section on
# all Big Brother alert pages. To create a new alert message, put whatever
# text you want into a new file, call it anything you like, but try to
# stick to the convention of group.service. Wildcards also work, but place
# them at the bottom of the file, so that absolute matches can override
# the wildcard entries.
# NOTE: Make sure there are no trailing spaces at the end of the line.
# I'll be adding in error checking code for that asap.
# Portal Application Servers rules group
hostname*.int.*.us.army.mil.disk appservers.disk
Army_Home_Page.http Army_Home_Page.http
mail*.http mail_servers
#
# Place all wildcard matches below here
#
*.cpu ALL.cpu
*.disk ALL.disk
*.msgs ALL.msgs
*.procs ALL.procs
*.http ALL.http
*.conn ALL.conn
----[cut]----
Then, in the same directory, you just create the files like appservers.disk,
or mail_servers, whatever you've called them, and the content loads whenever
anyone goes to a bb-dohostsvc.sh page that matches. It works really well,
and the only downside is having to ssh in and manually edit the conf file
and content files. But you can use any html code you want, and don't have to
worry about extra spaces, line feeds/carriage returns, etc.
What I need to do now is decide how best to proceed with setting this up in
Hobbit. I'd like to be able to edit the content from the web interface
somehow. The "Instruction" field in the existing nkedit is good for short
comments, but we've been using long descriptive html output with web links
and such. With some experimentation, I found that you can do the same thing
in nkedit, but you have to remove any special tags like nbsp; and all
newline characters or it makes the hobbit-nkview.cfg file unreadable.
I'm going to start looking at the source for bb-hostsvc.sh tomorrow to see
where I'd need to make changes, but I wanted to throw this out there to see
if anyone had any thoughts. If anyone else would also like my existing code
for BB, I can post that. :)
---
Matthew Epp
Sr Unix Engineer
Army Knowledge Online (PEO/EIS) / CherryRoad Technologies
Sitesupport Engineering (SEO)
More information about the Xymon
mailing list