Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| addons:xymonmap [2012/01/25 19:29] – external edit 127.0.0.1 | addons:xymonmap [2016/09/20 12:01] (current) – [xymonmap.pl] b-art | ||
|---|---|---|---|
| Line 93: | Line 93: | ||
| use strict; | use strict; | ||
| use XML:: | use XML:: | ||
| + | $XML:: | ||
| my $XYMONHOME = "/ | my $XYMONHOME = "/ | ||
| my $XYMON = " | my $XYMON = " | ||
| - | my $localhost = "mms-test"; | + | my $localhost = "localhost.localdomain"; |
| my $cgiloc = " | my $cgiloc = " | ||
| #PO - More information for the status message | #PO - More information for the status message | ||
| my $theEpoch = time(); | my $theEpoch = time(); | ||
| my $kaoDate = localtime($theEpoch); | my $kaoDate = localtime($theEpoch); | ||
| - | |||
| #PO - Declare $machineName and $testName and concatenate them for the links on the pop-ups. | #PO - Declare $machineName and $testName and concatenate them for the links on the pop-ups. | ||
| # | # | ||
| - | my ($machineName, | + | my ($machineName, |
| ######################## | ######################## | ||
| - | # Might need some degug | + | # Might need some debug |
| my $DEBUG = ' | my $DEBUG = ' | ||
| # You should use an FQDN or IP address of the XYMONServer | # You should use an FQDN or IP address of the XYMONServer | ||
| - | my $xymon_web_server = '172.29.153.62'; | + | my $xymon_web_server = " |
| # The top URL directory name for the Xymon webpages | # The top URL directory name for the Xymon webpages | ||
| my $xymon_web_folder = ' | my $xymon_web_folder = ' | ||
| Line 125: | Line 126: | ||
| #-------- Define the initial lat/long to display in the report | #-------- Define the initial lat/long to display in the report | ||
| - | my $init_lat = '4.726811'; | + | my $init_lat = '17.10430'; |
| - | my $init_long = '50.848775'; # This configuration is for the Leuven | + | my $init_long = '45.34530'; # This configuration is for the Servië |
| - | my $init_zoom_level = '9'; # | + | my $init_zoom_level = '4'; # |
| ######################## | ######################## | ||
| Line 135: | Line 136: | ||
| my $testFailed; | my $testFailed; | ||
| my $COLOR = ''; | my $COLOR = ''; | ||
| + | my $device = ' '; | ||
| + | my $sitecolor = " | ||
| my $pin_message; | my $pin_message; | ||
| my ($sec, | my ($sec, | ||
| $year = $year + 1900; | $year = $year + 1900; | ||
| + | |||
| # Start a log file, if it's empty when the script ends we'll delete it - so if it's there you know something went wrong. | # Start a log file, if it's empty when the script ends we'll delete it - so if it's there you know something went wrong. | ||
| my $ERRORFILE = "/ | my $ERRORFILE = "/ | ||
| open (STDERR, "> | open (STDERR, "> | ||
| - | |||
| open(OUT, "> $xymon_hist" | open(OUT, "> $xymon_hist" | ||
| Line 147: | Line 150: | ||
| # | # | ||
| # | # | ||
| - | |||
| process_data(); | process_data(); | ||
| - | |||
| html_end(); | html_end(); | ||
| close(OUT); | close(OUT); | ||
| Line 171: | Line 172: | ||
| #PO - substitute the commas for dots, but, this has to be converted back for the links to each status message on the pop-ups, PAINFUL!!! | #PO - substitute the commas for dots, but, this has to be converted back for the links to each status message on the pop-ups, PAINFUL!!! | ||
| $target_node =~ s/,/./g; | $target_node =~ s/,/./g; | ||
| - | | + | print " |
| + | print " | ||
| open (IN, "< " . $xymon_hist_path . $lf); | open (IN, "< " . $xymon_hist_path . $lf); | ||
| while (< | while (< | ||
| Line 182: | Line 183: | ||
| $color = $l1x[1]; | $color = $l1x[1]; | ||
| $testFailed = 0; | $testFailed = 0; | ||
| - | $testFailed = 1 if ($color eq ' | + | $testFailed = 1 if ($color eq ' |
| + | # | ||
| #PO - change commas to dots in the log file name | #PO - change commas to dots in the log file name | ||
| ($machineName, | ($machineName, | ||
| $lf =~ s/,/./g; | $lf =~ s/,/./g; | ||
| #PO - DEBUG output | #PO - DEBUG output | ||
| - | #print "Test Failed [$testFailed]: | + | print "Test Failed [$testFailed]: |
| } | } | ||
| } | } | ||
| Line 194: | Line 195: | ||
| if ($testFailed == 1) { | if ($testFailed == 1) { | ||
| - | $COLOR = ' | + | |
| + | # $COLOR = ' | ||
| + | $COLOR = 'green'; | ||
| $machineName =~ s/ | $machineName =~ s/ | ||
| $machineName =~ s/\.//g; | $machineName =~ s/\.//g; | ||
| + | if ($device eq $machineName){ | ||
| + | if ($color eq ' | ||
| + | $sitecolor = " | ||
| + | }elsif ($color eq ' | ||
| + | $sitecolor = " | ||
| + | }elsif ($color eq ' | ||
| + | $sitecolor = " | ||
| + | }else {$sitecolor = " | ||
| + | } | ||
| + | } else {$sitecolor = " | ||
| + | } | ||
| + | $device = $machineName; | ||
| next if ($color eq ' | next if ($color eq ' | ||
| - | #print " | + | # PO DEBUG output |
| - | + | print " | |
| - | #PO - For Windows: | + | $pin_message .= '< |
| - | $pin_message .= '< | + | #PO DEBUG output |
| print "< | print "< | ||
| - | |||
| - | |||
| $alert_locales-> | $alert_locales-> | ||
| my $tmp_locale = $lat_long_ref-> | my $tmp_locale = $lat_long_ref-> | ||
| Line 212: | Line 224: | ||
| push(@ary_alert_locales, | push(@ary_alert_locales, | ||
| } | } | ||
| - | } | + | } |
| + | print " | ||
| } | } | ||
| Line 231: | Line 244: | ||
| sub html_start() { | sub html_start() { | ||
| $COLOR = ' | $COLOR = ' | ||
| - | + | | |
| - | | + | |
| print (OUT ' | print (OUT ' | ||
| | | ||
| Line 261: | Line 273: | ||
| print (OUT ' | print (OUT ' | ||
| print (OUT ' | print (OUT ' | ||
| - | print (OUT ' | ||
| - | print (OUT ' | ||
| + | # print (OUT ' | ||
| + | print (OUT ' | ||
| + | # print (OUT ' | ||
| + | print (OUT ' | ||
| print (OUT ' | print (OUT ' | ||
| print (OUT ' | print (OUT ' | ||
| Line 295: | Line 309: | ||
| if(-z $ERRORFILE) { unlink $ERRORFILE; } | if(-z $ERRORFILE) { unlink $ERRORFILE; } | ||
| - | my $cmd = " | + | #my $cmd = " |
| + | my $cmd = " | ||
| - | print " | + | #print " |
| system ($cmd); | system ($cmd); | ||
| Line 375: | Line 390: | ||
| * **2012-01-20** | * **2012-01-20** | ||
| * Initial release | * Initial release | ||
| + | * **2016-09-20** | ||
| + | * Added alert color code onto the failing site. | ||
| + | * Changed webpage embedding in the Xymon page from iFrame to HTML5 embed TAG. | ||