This is a multi-part message in MIME format.
--------------000308070704030703050308
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
(I've submitted this patch about 2 years ago, but it wasn't considered
'feature complete' by then. And I didn't have the time to add the
missing features, as I didn't use them myself. But here it is again, now
complete)
Hello all,
For some services my action_url is set to view performance
data (graphs), while for other services the action_url is set to lead to
an external webbased system to perform additional commands.
To be able to see what action is to be performed in the Service Detail
overview , I would like to be able to define different images for
different actions.
The attached patch adds the field 'action_image' to be defined for
hosts, hostgroups, services, and service groups:
define service {
use template
host_name host1
service_description Load
action_url http://....
action_image graph.gif
action_image_alt View graphs
}
If the action_image is not defined, the default red "splat" icon is used.
If action_image_alt is not defined, the default text "Perform additional
actions" is used.
I have also added the notes_image (as requested previously) and
notes_image_alt keywords.
Attached patch is made against 3.2.3, and is already running on my
production Nagios servers.
I would be very happy if this patch can be included in the next Nagios
minor release. (probably 3.3.0 or something ?)
Regards,
Wim.
--------------000308070704030703050308
Content-Type: text/plain;
name="action_image-nagios-3.2.3.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="action_image-nagios-3.2.3.patch"
diff -rupN nagios-3.2.3-org/cgi/config.c nagios-3.2.3/cgi/config.c
--- nagios-3.2.3-org/cgi/config.c Wed Sep 1 16:19:59 2010
+++ nagios-3.2.3/cgi/config.c Fri Jan 7 14:17:06 2011
@@ -501,7 +501,11 @@ void display_hosts(void){
printf("Failure Prediction Options");
printf("Notes");
printf("Notes URL");
+ printf("Notes Image");
+ printf("Notes Image Alt");
printf("Action URL");
+ printf("Action Image");
+ printf("Action Image Alt");
printf("2-D Coords");
printf("3-D Coords");
printf("Statusmap Image");
@@ -723,8 +727,16 @@ void display_hosts(void){
=20
printf("%s",bg_class,(temp_host->notes_url=3D=3D=
NULL)?" ":html_encode(temp_host->notes_url,FALSE));
=20
+ printf("%s",bg_class,(temp_host->notes_image=3D=3D=
NULL)?" ":html_encode(temp_host->notes_image,FALSE));
+
+ printf("%s",bg_class,(temp_host->notes_image_alt=
=3D=3DNULL)?" ":html_encode(temp_host->notes_image_alt,FALSE));
+
printf("%s",bg_class,(temp_host->action_url=3D=3D=
NULL)?" ":html_encode(temp_host->action_url,FALSE));
=20
+ printf("%s",bg_class,(temp_host->action_image=3D=
=3DNULL)?" ":html_encode(temp_host->action_image,FALSE));
+
+ printf("%s",bg_class,(temp_host->action_image_al=
t=3D=3DNULL)?" ":html_encode(temp_host->action_image_alt,FALSE));
+
if(temp_host->have_2d_coords=3D=3DFALSE)
printf(" ",bg_class);
else
@@ -806,7 +818,11 @@ void display_hostgroups(void){
printf("Host Members");
printf("Notes");
printf("Notes URL");
+ printf("Notes Image");
+ printf("Notes Image Alt");
printf("Action URL");
+ printf("Action Image");
+ printf("Action Image Alt");
printf("\n");
=20
/* check all the hostgroups... */
@@ -842,8 +858,16 @@ void display_hostgroups(void){
=20
printf("<TD CLASS=3D'%
...[email truncated]...
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]