[Mon-commit] mon/doc README.site-customization, NONE, 1.1.2.1 monfailures.1, NONE, 1.1.2.1 skymon.1
Brought to you by:
trockij
From: Jim T. <tr...@us...> - 2009-12-28 21:11:54
|
Update of /cvsroot/mon/mon/doc In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv29441/doc Modified Files: Tag: mon-1-2-branch mon.8 moncmd.1 Added Files: Tag: mon-1-2-branch README.site-customization monfailures.1 skymon.1 Log Message: see CHANGES for details --- NEW FILE: README.site-customization --- mon.cgi has always been "customizable," in that the source was available and you were encouraged to substitute your own parameters (e.g., mon host, mon port, company logo, etc.). But this meant that with each new version, you had to go back and re-edit the source code. Not a big deal, but still something of a pain. As of v1.49, mon.cgi includes some features which are meant to facilitate these changes and make site-specific customizations easier to perform, especially as mon and mon.cgi continue to evolve. Creating Your Own Config File ----------------------------- Previous to v.1.49 of mon.cgi, you could customize the look of the page, but all customizations had to be done in the source itself. This has numerous disadvantages, so 1.49 introduces an *optional* config file which will be read only as necessary and will allow you to specify custom values for parameters without having to touch the source code each time. You can still edit the source each time if you want, but if you want to set up a config file, follow these steps: 1) Copy the config file (included with the mon.cgi distribution) config/mon.cgi.cf to a location of your choice. It's best to start with a sample config file, because the config file format is very simple, and it will give you a chance to see how it works and experiment with parameters. 2) Edit the mon.cgi source code to find the line that specifies the variable "$moncgi_config_file". Change the value to the filesystem path of your copy of your mon.cgi config file. 3) Now you can edit the config file and make changes at will. Every time you change the mtime of the file (e.g., by saving it in a text editor, or touch'ing the file), mon.cgi will re-read the config file and the changes will take effect. If there are errors in parsing the config file, they will go to STDERR, which in most setups will end up in your web server's error log. Look in the errors file if your config isn't working like you expect it to work. Adding A New Row And Custom Commands To The Command Button Bar -------------------------------------------------------------- Adding a new row to the command button bar, with corresponding custom commands, is quite a bit more involved than the relatively simple matter of changing a config file. If you've developed, or are interested in developing your own custom commands, however, this functionality might be just what you needed. In the following example, we add a command called "ack_all" to the button bar, and also add the routine to do the ack'ing. The actual guts of the ack_all routine aren't included, but the goal of these instructions is to give you enough to start off. The first step is to create your own moncgi_custom_print_bar function. A stub function exists in the mon.cgi code, and the below code shows you how you would put in your own function that has one button, labeled "Acknowledge All Failures". Sample moncgi_custom_print_bar subroutine: sub moncgi_custom_print_bar { # # This is a sample routine, which adds a third row to the # command table, with one command: "Acknowledge All Failures" # my ($face)= (@_); $webpage->print("<tr>\n"); $webpage->print("\t<td colspan=7 align=center><font FACE=\"$face\"><a href=$url?${monhost_and_port_args}command=ack_all>Acknowledge All Failures</a></font></td>\n"); $webpage->print("</tr>\n"); } The next step is to tell mon.cgi that you are using your own custom commands, by creating your own moncgi_custom_commands subroutine. Again, there is a sample function in the mon.cgi code which you can replace with your own. Sample moncgi_custom_commands subroutine: sub moncgi_custom_commands { if ($command eq "ack_all") { # # Set up the page # &setup_page("Acknowledge All Alarms"); # # Note: you would have to write the "ack all" # command yourself! &moncgi_ack_all; } else { # # We didn't find anything, return # return 0; } return 1; # we did find something, suppress further command processing } The last step is to create the actual subroutines which will do the custom work you want them to do (assuming you weren't just calling existing commands in a different way. In our example, this means we have to write a function that actually goes out and acks all existing failures. We won't do this here, but hopefully this gives you an idea of how to proceed. sub moncgi_ack_all { # # Here is where the actual code to do the "ack all" would go # } When future releases of mon.cgi come out, you can copy and paste your custom subroutines and be up and running with the new version in minimal time. At least, that is what this was designed for. --- NEW FILE: monfailures.1 --- .\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH MONFAILURES 1 "September 4, 2009" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp <n> insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME monfailures \- Lists mon failures .SH SYNOPSIS .B monfailures .br .SH DESCRIPTION .PP \fBmonfailures\fP is a program that lists the latest mon failures. .SH SEE ALSO .BR mon (8), .BR monshow (1). .SH AUTHOR monfailures was written by Dario Minnucci (midget)<de...@mi...>. .PP This manual page was written by Dario Minnucci (midget) <de...@mi...>, for the Debian project (and may be used by others). --- NEW FILE: skymon.1 --- .\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp <n> insert n+1 empty lines .\" for manpage-specific macros, see man(7) .TH "SKYMON" "1" "February 12, 2007" "Dario Minnucci <de...@mi...>" "" .SH "NAME" skymon \- "moncmd" interface to a SkyTel 2\-way pager .SH "DESCRIPTION" .PP .\" TeX users may be more comfortable with the \fB<whatever>\fP and .\" \fI<whatever>\fP escape sequences to invode bold face and italics, .\" respectively. \fBskymon\fP This is a "moncmd" interface to a SkyTel 2\-way pager. .PP It utilizes procmail filters and password authentication to do its trick. I would not call this a "secure" authentication mechanism, but in Marcus Ranum\-speak it is "really nice". Use at your own risk. .PP It would be even more "really nice" if this did SecureID or S/Key. .PP Also keep in mind that all queries and all results pass through the Great Wide Internet to get back to your pager. .PP Also keep in mind that this is more useful as an example for a DIY project than for anything else. .SH "OPERATION" Commands are sent via email with the following format: /password:command Commands are the following, and can only be used if they exist in the "allow" file: .TP .B eh Enable host .TP .B es Enable service .TP .B ew Enable watch .TP .B dh host reason Disable host .TP .B ds watch service reason Disable service .TP .B dw watch reason Disable watch .TP .B lf List failures .TP .B ld List disabled .PP The idea behind the brevity is that it's a pain to compose messages on that silly little keypad. .SH "SEE ALSO" .BR mon (8), .BR moncmd (1), .BR monshow (1) .SH "AUTHOR" skymon was written by Jim Trocki, <tr...@tr...> .PP This manual page was written by Dario Minnucci <de...@mi...>, for the Debian project (but may be used by others). Index: moncmd.1 =================================================================== RCS file: /cvsroot/mon/mon/doc/moncmd.1,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** moncmd.1 17 Apr 2005 07:42:27 -0000 1.2 --- moncmd.1 28 Dec 2009 21:11:46 -0000 1.2.2.1 *************** *** 65,73 **** on the command line, then commands will be taken from either standard input, or from ! the file specified by the -f parameter. If standard input is connected ! to a TTY and the -a option is supplied, then it will prompt for a password. ! If the -a option is supplied without the -f option and standard input is not a TTY, then the username and password are read from --- 65,73 ---- on the command line, then commands will be taken from either standard input, or from ! the file specified by the \-f parameter. If standard input is connected ! to a TTY and the \-a option is supplied, then it will prompt for a password. ! If the \-a option is supplied without the \-f option and standard input is not a TTY, then the username and password are read from *************** *** 79,83 **** for obvious security reasons. ! If the username is neither supplied by the -l parameter or through standard input, it is taken from the effective user ID of the --- 79,83 ---- for obvious security reasons. ! If the username is neither supplied by the \-l parameter or through standard input, it is taken from the effective user ID of the Index: mon.8 =================================================================== RCS file: /cvsroot/mon/mon/doc/mon.8,v retrieving revision 1.6.2.3 retrieving revision 1.6.2.4 diff -C2 -d -r1.6.2.3 -r1.6.2.4 *** mon.8 25 Jun 2007 13:10:07 -0000 1.6.2.3 --- mon.8 28 Dec 2009 21:11:46 -0000 1.6.2.4 *************** *** 257,261 **** .br \fC ! monitor fping.monitor -t 4000 -r 2 \fR .br --- 257,261 ---- .br \fC ! monitor fping.monitor \-t 4000 \-r 2 \fR .br *************** *** 264,268 **** .br \fC ! MONITOR_DIR/fping.monitor -t 4000 -r 2 smtp nntp ns \fR .br --- 264,268 ---- .br \fC ! MONITOR_DIR/fping.monitor \-t 4000 \-r 2 smtp nntp ns \fR .br *************** *** 1608,1612 **** period wd {Sun-Sat} alert mail.alert so...@yo... ! upalert mail.alert -u so...@yo... .fi --- 1608,1612 ---- period wd {Sun-Sat} alert mail.alert so...@yo... ! upalert mail.alert \-u so...@yo... .fi *************** *** 1648,1652 **** period wd {Sun-Sat} alert mail.alert so...@yo... ! upalert mail.alert -u so...@yo... .fi --- 1648,1652 ---- period wd {Sun-Sat} alert mail.alert so...@yo... ! upalert mail.alert \-u so...@yo... .fi |