Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| addons:hobbitnotes [2017/12/05 05:51] – [notes header for 4.3] wikiadmin | addons:hobbitnotes [2017/12/05 05:54] (current) – [Xymon Notes Editor] wikiadmin | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| ^ Requirements | Perl, HTML:: | ^ Requirements | Perl, HTML:: | ||
| ^ Download | None | | ^ Download | None | | ||
| - | ^ Last Update | 2012-01-03 | | + | ^ Last Update | 2017-12-05 | |
| ===== Description ===== | ===== Description ===== | ||
| Line 178: | Line 178: | ||
| <hidden onHidden=" | <hidden onHidden=" | ||
| <code html> | <code html> | ||
| - | < | + | |
| - | <TABLE SUMMARY=" | + | |
| - | < | + | < |
| - | <TD> <HR WIDTH=" | + | <TD> <HR WIDTH=" |
| - | </ | + | </ |
| - | < | + | < |
| - | <TD ALIGN=RIGHT>< | + | <TD ALIGN=RIGHT>< |
| - | </ | + | </ |
| - | </ | + | </ |
| </ | </ | ||
| Line 469: | Line 469: | ||
| use CGI ": | use CGI ": | ||
| use HTML:: | use HTML:: | ||
| - | |||
| # Your $XYMONHOME | # Your $XYMONHOME | ||
| Line 475: | Line 474: | ||
| my $xymon_cmd = " | my $xymon_cmd = " | ||
| # xymon config file | # xymon config file | ||
| - | my $xymoncfg=" | + | my $xymoncfg = " |
| - | # The web path to gifs. | + | |
| - | #my $xymon_web | + | |
| - | # xymon_gifs appears to be unused | + | |
| - | #my $xymon_gifs = " | + | |
| # The actual www notes dir on the server | # The actual www notes dir on the server | ||
| Line 487: | Line 482: | ||
| my $xymon_header = " | my $xymon_header = " | ||
| my $xymon_footer = " | my $xymon_footer = " | ||
| + | |||
| #Standard hosts.cfg file | #Standard hosts.cfg file | ||
| my $xymon_hosts = " | my $xymon_hosts = " | ||
| - | my $xymon_showhosts | + | my $xymon_menu |
| # No changes needed below. | # No changes needed below. | ||
| Line 504: | Line 500: | ||
| # Set up the environment variables and dynamic variables from xymonserver.cfg | # Set up the environment variables and dynamic variables from xymonserver.cfg | ||
| foreach (`$xymon_home/ | foreach (`$xymon_home/ | ||
| - | | + | |
| - | next if $_ =~ / | + | next if $_ =~ / |
| - | my ($var,$val) = / | + | my ($var,$val) = / |
| - | $ENV{$var} | + | $ENV{$var} = $val; |
| } | } | ||
| - | |||
| - | # not used | ||
| - | # | ||
| sub print_notesdata { | sub print_notesdata { | ||
| - | | + | |
| - | while (< | + | while (< |
| - | print; | + | print; |
| - | } | + | } |
| - | close NOTESDATA; | + | close NOTESDATA; |
| } | } | ||
| sub write_notesdata { | sub write_notesdata { | ||
| - | | + | |
| - | print NOTESDATA $note; | + | print NOTESDATA $note; |
| - | close NOTESDATA; | + | close NOTESDATA; |
| } | } | ||
| sub make_note { | sub make_note { | ||
| - | | + | |
| - | my $note = " | + | my $note = " |
| - | | + | |
| - | select NOTE; | + | select NOTE; |
| - | & | + | & |
| - | & | + | & |
| - | & | + | & |
| - | select STDOUT; | + | select STDOUT; |
| - | close NOTE; | + | close NOTE; |
| } | } | ||
| sub save_note { | sub save_note { | ||
| - | | + | |
| - | & | + | & |
| - | & | + | & |
| - | print '< | + | print '< |
| - | & | + | & |
| } | } | ||
| sub edit_note { | sub edit_note { | ||
| - | | + | |
| - | my $t2h = HTML:: | + | my $t2h = HTML:: |
| - | blockcode | + | blockcode |
| - | lines => 1, | + | lines => 1, |
| - | tables | + | tables |
| - | bullets | + | bullets |
| - | numbers | + | numbers |
| - | urls => 1, | + | urls => 1, |
| - | email => 1, | + | email => 1, |
| - | bold => 1, | + | bold => 1, |
| - | underline | + | underline |
| - | }); | + | }); |
| - | $note = $t2h-> | + | $note = $t2h-> |
| - | #$note =~ s/ | + | #$note =~ s/ |
| - | } | + | } |
| - | | + | |
| - | $note =~ s/< | + | $note =~ s/< |
| - | } | + | } |
| - | | + | |
| < | < | ||
| <TABLE BORDER=" | <TABLE BORDER=" | ||
| Line 581: | Line 574: | ||
| < | < | ||
| HTML | HTML | ||
| - | | + | |
| - | print $note; | + | print $note; |
| - | } elsif ($lines[0]) { | + | } elsif ($lines[0]) { |
| - | print @lines; | + | print @lines; |
| - | } else { | + | } else { |
| - | print '< | + | print '< |
| - | print << | + | print << |
| </ | </ | ||
| <input name=" | <input name=" | ||
| Line 599: | Line 592: | ||
| sub print_note { | sub print_note { | ||
| + | print << | ||
| + | < | ||
| + | <TABLE WIDTH=" | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | <TR> | ||
| + | <TD> | ||
| + | HTML | ||
| + | if ($lines[0]) { | ||
| + | print @lines; | ||
| print << | print << | ||
| - | < | + | |
| + | </ | ||
| + | < | ||
| + | <TD ALIGN=" | ||
| + | | ||
| + | <input type="hidden" | ||
| HTML | HTML | ||
| - | if ($lines[0]) { | + | } elsif ($cmd =~ /preview/) { |
| - | print @lines; | + | print << |
| - | | + | |
| - | </ | + | |
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| HTML | HTML | ||
| - | | + | |
| - | print << | + | print << |
| - | $note</ | + | The are no notes for $host [$hosts{$host}]. |
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| HTML | HTML | ||
| - | | + | |
| - | print << | + | print << |
| - | The are no notes for $host [$hosts{$host}].</ | + | <input type=" |
| - | HTML | + | |
| - | | + | |
| - | | + | |
| - | <input type=" | + | |
| + | </ | ||
| HTML | HTML | ||
| } | } | ||
| # | # | ||
| sub print_error { | sub print_error { | ||
| - | | + | |
| - | print "< | + | print "< |
| } | } | ||
| sub get_note { | sub get_note { | ||
| - | | + | |
| - | open (NOTE, "< | + | open (NOTE, "< |
| - | while (my $note = < | + | while (my $note = < |
| - | push @lines, $note; | + | push @lines, $note; |
| - | } | + | |
| - | close NOTE; | + | |
| } | } | ||
| + | close NOTE; | ||
| + | } | ||
| } | } | ||
| sub print_menu { | sub print_menu { | ||
| - | | + | |
| - | for my $host(sort keys %hosts) { | + | for my $host(sort keys %hosts) { |
| - | print << | + | print << |
| < | < | ||
| < | < | ||
| HTML | HTML | ||
| - | | + | |
| - | print '</ | + | print '</ |
| } | } | ||
| sub get_hosts { | sub get_hosts { | ||
| - | | + | |
| - | while (< | + | while (< |
| - | my ($hostname, $hostip, @dummy) = split(' | + | my ($hostname, $hostip, @dummy) = split(' |
| - | $hosts{$hostname} = $hostip; | + | $hosts{$hostname} = $hostip; |
| - | } | + | } |
| - | close HOSTS; | + | close HOSTS; |
| } | } | ||
| sub print_header { | sub print_header { | ||
| - | | + | |
| - | print " | + | print " |
| - | open (HEAD, "< | + | open (HEAD, "< |
| - | while (< | + | while (< |
| - | # It's a bit hard to edit with a refresh ;) | + | # It's a bit hard to edit with a refresh ;) |
| - | if (/META/i && / | + | if (/META/i && / |
| - | s/& | + | s/& |
| - | s/& | + | s/& |
| - | s/& | + | s/& |
| - | s/& | + | s/& |
| - | s/& | + | s/& |
| - | s/& | + | s/& |
| - | s/& | + | s/& |
| - | s/& | + | s/& |
| + | |||
| + | if (/& | ||
| + | s/& | ||
| + | open (MENU, "< | ||
| + | while (< | ||
| + | s/ | ||
| + | s/ | ||
| + | s/ | ||
| print; | print; | ||
| + | } | ||
| + | close MENU; | ||
| } | } | ||
| - | close HEAD; | + | |
| + | } | ||
| + | | ||
| } | } | ||
| sub print_footer { | sub print_footer { | ||
| - | | + | |
| - | while (< | + | while (< |
| - | s/& | + | s/& |
| - | s/& | + | s/& |
| - | print; | + | print; |
| - | } | + | } |
| - | close FOOT; | + | close FOOT; |
| } | } | ||
| Line 693: | Line 726: | ||
| & | & | ||
| if ($cmd =~ / | if ($cmd =~ / | ||
| - | | + | |
| - | & | + | & |
| } elsif ($cmd eq ' | } elsif ($cmd eq ' | ||
| - | | + | |
| - | & | + | & |
| } elsif ($cmd eq ' | } elsif ($cmd eq ' | ||
| - | | + | |
| } elsif ($cmd eq ' | } elsif ($cmd eq ' | ||
| - | | + | |
| } elsif ($cmd eq ' | } elsif ($cmd eq ' | ||
| - | | + | |
| } else { | } else { | ||
| - | | + | |
| } | } | ||
| Line 712: | Line 745: | ||
| $| = $oldbar; | $| = $oldbar; | ||
| select ($cfh); | select ($cfh); | ||
| + | |||
| </ | </ | ||
| </ | </ | ||