Re: [Nagios-devel] Showing contactgroups and notification period

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

Re: [Nagios-devel] Showing contactgroups and notification period

Post by Guest »


> Yes, most certainly.

So be it.

I'm starting to get the hang of Nagios data strucures :-)

/Markus
--------------------------

--- extinfo.c 2009-01-13 10:01:00.000000000 +0100
+++ ../extinfo.c 2009-01-13 10:29:11.000000000 +0100
@@ -139,6 +139,9 @@
hostgroup *temp_hostgroup=3DNULL;
service *temp_service=3DNULL;
servicegroup *temp_servicegroup=3DNULL;
+
+ contactgroupsmember *temp_contactgroups=3DNULL;
+
=20
=20
/* get the arguments passed in the URL */
@@ -338,8 +341,24 @@
if(found=3D=3DFALSE)
printf("No hostgroups");
printf("\n");
+
+ /* *********************** List contact
groups **********/+ printf("Contactgroups");+
for(temp_contactgroups=3Dtemp_host->contact_groups;temp_contactgroups!=3D=
NUL
L;temp_contactgroups=3Dtemp_contactgroups->next){
+
printf("%s",temp_contactgroups->group_name);
+ if(temp_contactgroups ->next){
+ printf(", ");
+ }
+ }
+
+ printf("\n");
++ printf("Notification
Period");
+ printf("%s",
temp_host->notification_period);
+ printf("\n");
printf("%s\n",temp_host->address);
- }
+ }
+ =20
=20
if(display_type=3D=3DDISPLAY_SERVICE_INFO){
printf("Service%sOn
Host\n",service_desc);
@@ -359,7 +378,22 @@
printf("No servicegroups.");
printf("\n");
=20
+
+ /* *********************** List contact
groups **********/+ printf("Contactgroups");+
for(temp_contactgroups=3Dtemp_service->contact_groups;temp_contactgroups!=
=3D
NULL;temp_contactgroups=3Dtemp_contactgroups->next){
+
printf("%s",temp_contactgroups->group_name);
+ if(temp_contactgroups ->next){
+ printf(", ");
+ }
+ }
+
+ printf("\n");+
printf("Notification Period");
+ printf("%s",
temp_service->notification_period);
+ printf("\n");
printf("%s\n",temp_host->address);
+
}
if(display_type=3D=3DDISPLAY_HOSTGROUP_INFO){
printf("Hostgroup\n");





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked