[Nagios-devel] Patch to status cgi for host/service notes and actions links
Posted: Wed Jun 23, 2004 8:33 am
This is a multi-part message in MIME format.
------=_NextPart_000_000F_01C4590D.853CD5A0
Content-Type: text/plain;
format=flowed;
charset="iso-8859-1";
reply-type=original
Content-Transfer-Encoding: 7bit
The attached patch changes the way notes/action links are created.
The new behavior is notes and action links with predefined icons will be
created for both hosts and services if both are defined. If only one is
defined then it tries to link that url to the icon image that is defined.
If no icon image is defined then it falls back to using the default icon for
the notes/action.
This makes clicking on the extinfo icon behave more like it did in nagios
v1.0 unless you have both actions and notes defined.
-Shad
------=_NextPart_000_000F_01C4590D.853CD5A0
Content-Type: application/octet-stream;
name="nagios-2.0-status_links.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="nagios-2.0-status_links.patch"
diff -ruN nagios-2.0a1.old/cgi/status.c nagios-2.0a1/cgi/status.c=0A=
--- nagios-2.0a1.old/cgi/status.c 2004-03-23 22:22:03.000000000 -0700=0A=
+++ nagios-2.0a1/cgi/status.c 2004-06-23 10:13:59.000000000 -0600=0A=
@@ -1555,27 +1555,40 @@=0A=
printf("",EXTINFO_CGI,DISPLAY_HOST_INFO,url_encode(temp_status=
->host_name),url_images_path,SCHEDULED_DOWNTIME_ICON,STATUS_ICON_WIDTH,ST=
ATUS_ICON_HEIGHT);=0A=
}=0A=
if(temp_hostextinfo!=3DNULL){=0A=
- if(temp_hostextinfo->notes_url!=3DNULL){=0A=
- printf("");=0A=
- printf("host_name,temp_hostextinfo->notes_=
url);=0A=
- printf("' TARGET=3D'_blank'>");=0A=
- printf("",url_images_path,NOTES_ICON,STATUS_ICON_WIDTH,STATUS_ICON_H=
EIGHT,"View Extra Host Notes","View Extra Host Notes");=0A=
- printf("");=0A=
- printf("\n");=0A=
- }=0A=
- if(temp_hostextinfo->action_url!=3DNULL){=0A=
- printf("");=0A=
- printf("host_name,temp_hostextinfo->action=
_url);=0A=
- printf("' TARGET=3D'_blank'>");=0A=
- printf("",url_images_path,ACTION_ICON,STATUS_ICON_WIDTH,STATUS_ICON_=
HEIGHT,"Perform Extra Host Actions","Perform Extra Host Actions");=0A=
- printf("");=0A=
- printf("\n");=0A=
+ if((temp_hostextinfo->notes_url!=3DNULL && =
temp_hostextinfo->action_url!=3DNULL) || =
temp_hostextinfo->icon_image=3D=3DNULL){=0A=
+ if(temp_hostextinfo->notes_url!=3DNULL){=0A=
+ printf("");=0A=
+ printf("host_name,temp_hostextinfo->notes_=
url);=0A=
+ printf("' TARGET=3D'_blank'>");=0A=
+ printf("",url_images_path,NOTES_ICON,STATUS_ICON_WIDTH,STATUS_ICON_H=
EIGHT,"View Extra Host Notes","View Extra Host Notes");=0A=
+ printf("");=0A=
+ printf("\n");=0A=
+ }=0A=
+ if(temp_hostextinfo->action_url!=3DNULL){=0A=
+ printf("");=0A=
+ printf("host_name,temp_hostextinfo->action=
_url);=0A=
+ printf("' TARGET=3D'_blank'>");=0A=
+ printf("",url_images_path,ACTION_ICON,STATUS_ICON_WIDTH,STATUS_ICON_=
HEIGHT,"Perform Extra Host Actions","Perform Extra Host Actions");=0A=
+ printf("");=0A=
+ p
...[email truncated]...
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
------=_NextPart_000_000F_01C4590D.853CD5A0
Content-Type: text/plain;
format=flowed;
charset="iso-8859-1";
reply-type=original
Content-Transfer-Encoding: 7bit
The attached patch changes the way notes/action links are created.
The new behavior is notes and action links with predefined icons will be
created for both hosts and services if both are defined. If only one is
defined then it tries to link that url to the icon image that is defined.
If no icon image is defined then it falls back to using the default icon for
the notes/action.
This makes clicking on the extinfo icon behave more like it did in nagios
v1.0 unless you have both actions and notes defined.
-Shad
------=_NextPart_000_000F_01C4590D.853CD5A0
Content-Type: application/octet-stream;
name="nagios-2.0-status_links.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="nagios-2.0-status_links.patch"
diff -ruN nagios-2.0a1.old/cgi/status.c nagios-2.0a1/cgi/status.c=0A=
--- nagios-2.0a1.old/cgi/status.c 2004-03-23 22:22:03.000000000 -0700=0A=
+++ nagios-2.0a1/cgi/status.c 2004-06-23 10:13:59.000000000 -0600=0A=
@@ -1555,27 +1555,40 @@=0A=
printf("",EXTINFO_CGI,DISPLAY_HOST_INFO,url_encode(temp_status=
->host_name),url_images_path,SCHEDULED_DOWNTIME_ICON,STATUS_ICON_WIDTH,ST=
ATUS_ICON_HEIGHT);=0A=
}=0A=
if(temp_hostextinfo!=3DNULL){=0A=
- if(temp_hostextinfo->notes_url!=3DNULL){=0A=
- printf("");=0A=
- printf("host_name,temp_hostextinfo->notes_=
url);=0A=
- printf("' TARGET=3D'_blank'>");=0A=
- printf("",url_images_path,NOTES_ICON,STATUS_ICON_WIDTH,STATUS_ICON_H=
EIGHT,"View Extra Host Notes","View Extra Host Notes");=0A=
- printf("");=0A=
- printf("\n");=0A=
- }=0A=
- if(temp_hostextinfo->action_url!=3DNULL){=0A=
- printf("");=0A=
- printf("host_name,temp_hostextinfo->action=
_url);=0A=
- printf("' TARGET=3D'_blank'>");=0A=
- printf("",url_images_path,ACTION_ICON,STATUS_ICON_WIDTH,STATUS_ICON_=
HEIGHT,"Perform Extra Host Actions","Perform Extra Host Actions");=0A=
- printf("");=0A=
- printf("\n");=0A=
+ if((temp_hostextinfo->notes_url!=3DNULL && =
temp_hostextinfo->action_url!=3DNULL) || =
temp_hostextinfo->icon_image=3D=3DNULL){=0A=
+ if(temp_hostextinfo->notes_url!=3DNULL){=0A=
+ printf("");=0A=
+ printf("host_name,temp_hostextinfo->notes_=
url);=0A=
+ printf("' TARGET=3D'_blank'>");=0A=
+ printf("",url_images_path,NOTES_ICON,STATUS_ICON_WIDTH,STATUS_ICON_H=
EIGHT,"View Extra Host Notes","View Extra Host Notes");=0A=
+ printf("");=0A=
+ printf("\n");=0A=
+ }=0A=
+ if(temp_hostextinfo->action_url!=3DNULL){=0A=
+ printf("");=0A=
+ printf("host_name,temp_hostextinfo->action=
_url);=0A=
+ printf("' TARGET=3D'_blank'>");=0A=
+ printf("",url_images_path,ACTION_ICON,STATUS_ICON_WIDTH,STATUS_ICON_=
HEIGHT,"Perform Extra Host Actions","Perform Extra Host Actions");=0A=
+ printf("");=0A=
+ p
...[email truncated]...
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]