[Nagios-devel] Possible feature patch - Excluding with
Posted: Thu Jun 26, 2008 5:55 am
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi list,
I would like to know if it is possible to excluding Hosts, services, groups and so on
excluding with use_true_regex-Option?
I have written a patch, which allow by use_true_regexp_matching=1, Excluding.
- --- nagios-3.0.3.orig/xdata/xodtemplate.c 2008-06-23 23:43:22.000000000 +0200
+++ nagios-3.0.3/xdata/xodtemplate.c 2008-06-26 15:28:24.000000000 +0200
@@ -13345,6 +13345,12 @@
~ /* strip trailing spaces */
~ strip(temp_ptr);
+ /* this contactgroup should be excluded (rejected) */
+ if(temp_ptr[0]=='!'){
+ reject_item=TRUE;
+ temp_ptr++;
+ }
+
~ /* should we use regular expression matching? */
~ if(use_regexp_matches==TRUE && (use_true_regexp_matching==TRUE || strstr(temp_ptr,"*") || strstr(temp_ptr,"?") || strstr(temp_ptr,"+") || strstr(temp_ptr,"\\.")))
~ use_regexp=TRUE;
@@ -13377,7 +13383,7 @@
~ continue;
~ /* add contactgroup members to list */
- - xodtemplate_add_contactgroup_members_to_memberlist(list,temp_contactgroup,_config_file,_start_line);
+ xodtemplate_add_contactgroup_members_to_memberlist((reject_item==TRUE)?reject_list:list,temp_contactgroup,_config_file,_start_line);
~ }
~ /* free memory allocated to compiled regexp */
@@ -13399,19 +13405,13 @@
~ continue;
~ /* add contactgroup to list */
- - xodtemplate_add_contactgroup_members_to_memberlist(list,temp_contactgroup,_config_file,_start_line);
+ xodtemplate_add_contactgroup_members_to_memberlist((reject_item==TRUE)?reject_list:list,temp_contactgroup,_config_file,_start_line);
~ }
~ }
~ /* else this is just a single contactgroup... */
~ else{
- - /* this contactgroup should be excluded (rejected) */
- - if(temp_ptr[0]=='!'){
- - reject_item=TRUE;
- - temp_ptr++;
- - }
- -
~ /* find the contactgroup */
~ temp_contactgroup=xodtemplate_find_real_contactgroup(temp_ptr);
~ if(temp_contactgroup!=NULL){
@@ -13468,6 +13468,12 @@
~ /* strip trailing spaces */
~ strip(temp_ptr);
+ /* this contact should be excluded (rejected) */
+ if(temp_ptr[0]=='!'){
+ reject_item=TRUE;
+ temp_ptr++;
+ }
+
~ /* should we use regular expression matching? */
~ if(use_regexp_matches==TRUE && (use_true_regexp_matching==TRUE || strstr(temp_ptr,"*") || strstr(temp_ptr,"?") || strstr(temp_ptr,"+") || strstr(temp_ptr,"\\.")))
~ use_regexp=TRUE;
@@ -13498,7 +13504,7 @@
~ continue;
~ /* add contact to list */
- - xodtemplate_add_member_to_memberlist(list,temp_contact->contact_name,NULL);
+ xodtemplate_add_member_to_memberlist((reject_item==TRUE)?reject_list:list,temp_contact->contact_name,NULL);
~ }
~ /* free memory allocated to compiled regexp */
@@ -13523,19 +13529,13 @@
~ continue;
~ /* add contact to list */
- - xodtemplate_add_member_to_memberlist(list,temp_contact->contact_name,NULL);
+ xodtemplate_add_member_to_memberlist((reject_item==TRUE)?reject_list:list,temp_contact->contact_name,NULL);
~ }
~ }
~ /* else this is just a single contact... */
~ else{
- - /* this contact should be excluded (rejected) */
- - if(temp_ptr[0]=='!'){
- - reject_item=TRUE;
- - temp_ptr++;
- - }
- -
~ /* find the contact */
~ temp_contact=xodtemplate_find_real_contact(temp_ptr);
~ if(temp_contact!=NULL){
@@ -13696,6 +13696,12 @@
~ /* strip trailing spaces */
~ strip(temp_ptr);
+ /* this hostgroup should be excluded (rejected) */
+ if(temp_ptr[0]=='!'){
+ reject_item=TRUE;
+ temp_ptr++;
+ }
+
~ /* should we use regular expression matching? */
~ if(use_regexp_matches==TRUE && (use_true_regexp_matching==TRUE || strstr(temp_ptr,"*") || strstr(temp_ptr,"?") || strstr(temp_ptr,"+") || strstr(temp_ptr,"\\.")))
~ use_regexp=TRUE;
@@ -13728,7 +13734,7 @@
~ continue;
~ /* add hostgroup members to list */
- - xodtemplate_add_hostgroup_members_to_memberlist(list,temp_hostgroup,_config_file,_start_line);
+ xodtemplate_add_hostgro
...[email truncated]...
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Hash: SHA1
Hi list,
I would like to know if it is possible to excluding Hosts, services, groups and so on
excluding with use_true_regex-Option?
I have written a patch, which allow by use_true_regexp_matching=1, Excluding.
- --- nagios-3.0.3.orig/xdata/xodtemplate.c 2008-06-23 23:43:22.000000000 +0200
+++ nagios-3.0.3/xdata/xodtemplate.c 2008-06-26 15:28:24.000000000 +0200
@@ -13345,6 +13345,12 @@
~ /* strip trailing spaces */
~ strip(temp_ptr);
+ /* this contactgroup should be excluded (rejected) */
+ if(temp_ptr[0]=='!'){
+ reject_item=TRUE;
+ temp_ptr++;
+ }
+
~ /* should we use regular expression matching? */
~ if(use_regexp_matches==TRUE && (use_true_regexp_matching==TRUE || strstr(temp_ptr,"*") || strstr(temp_ptr,"?") || strstr(temp_ptr,"+") || strstr(temp_ptr,"\\.")))
~ use_regexp=TRUE;
@@ -13377,7 +13383,7 @@
~ continue;
~ /* add contactgroup members to list */
- - xodtemplate_add_contactgroup_members_to_memberlist(list,temp_contactgroup,_config_file,_start_line);
+ xodtemplate_add_contactgroup_members_to_memberlist((reject_item==TRUE)?reject_list:list,temp_contactgroup,_config_file,_start_line);
~ }
~ /* free memory allocated to compiled regexp */
@@ -13399,19 +13405,13 @@
~ continue;
~ /* add contactgroup to list */
- - xodtemplate_add_contactgroup_members_to_memberlist(list,temp_contactgroup,_config_file,_start_line);
+ xodtemplate_add_contactgroup_members_to_memberlist((reject_item==TRUE)?reject_list:list,temp_contactgroup,_config_file,_start_line);
~ }
~ }
~ /* else this is just a single contactgroup... */
~ else{
- - /* this contactgroup should be excluded (rejected) */
- - if(temp_ptr[0]=='!'){
- - reject_item=TRUE;
- - temp_ptr++;
- - }
- -
~ /* find the contactgroup */
~ temp_contactgroup=xodtemplate_find_real_contactgroup(temp_ptr);
~ if(temp_contactgroup!=NULL){
@@ -13468,6 +13468,12 @@
~ /* strip trailing spaces */
~ strip(temp_ptr);
+ /* this contact should be excluded (rejected) */
+ if(temp_ptr[0]=='!'){
+ reject_item=TRUE;
+ temp_ptr++;
+ }
+
~ /* should we use regular expression matching? */
~ if(use_regexp_matches==TRUE && (use_true_regexp_matching==TRUE || strstr(temp_ptr,"*") || strstr(temp_ptr,"?") || strstr(temp_ptr,"+") || strstr(temp_ptr,"\\.")))
~ use_regexp=TRUE;
@@ -13498,7 +13504,7 @@
~ continue;
~ /* add contact to list */
- - xodtemplate_add_member_to_memberlist(list,temp_contact->contact_name,NULL);
+ xodtemplate_add_member_to_memberlist((reject_item==TRUE)?reject_list:list,temp_contact->contact_name,NULL);
~ }
~ /* free memory allocated to compiled regexp */
@@ -13523,19 +13529,13 @@
~ continue;
~ /* add contact to list */
- - xodtemplate_add_member_to_memberlist(list,temp_contact->contact_name,NULL);
+ xodtemplate_add_member_to_memberlist((reject_item==TRUE)?reject_list:list,temp_contact->contact_name,NULL);
~ }
~ }
~ /* else this is just a single contact... */
~ else{
- - /* this contact should be excluded (rejected) */
- - if(temp_ptr[0]=='!'){
- - reject_item=TRUE;
- - temp_ptr++;
- - }
- -
~ /* find the contact */
~ temp_contact=xodtemplate_find_real_contact(temp_ptr);
~ if(temp_contact!=NULL){
@@ -13696,6 +13696,12 @@
~ /* strip trailing spaces */
~ strip(temp_ptr);
+ /* this hostgroup should be excluded (rejected) */
+ if(temp_ptr[0]=='!'){
+ reject_item=TRUE;
+ temp_ptr++;
+ }
+
~ /* should we use regular expression matching? */
~ if(use_regexp_matches==TRUE && (use_true_regexp_matching==TRUE || strstr(temp_ptr,"*") || strstr(temp_ptr,"?") || strstr(temp_ptr,"+") || strstr(temp_ptr,"\\.")))
~ use_regexp=TRUE;
@@ -13728,7 +13734,7 @@
~ continue;
~ /* add hostgroup members to list */
- - xodtemplate_add_hostgroup_members_to_memberlist(list,temp_hostgroup,_config_file,_start_line);
+ xodtemplate_add_hostgro
...[email truncated]...
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]