Changeset 7075a66d0bf9d872f936eee678a49cfbc5cd46c5

Show
Ignore:
Timestamp:
02/26/08 16:00:11 (6 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1204041611 +0000
git-parent:

[f8c4ac748cb38d6b31387f62069fce0ff7287322]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1204041611 +0000
Message:

Make sure that checks can be selected as both targetname and targetmodule`name.
Show full targetmodulename when listing checks.
When creating new checks, create them disabled. Creating a check now looks like:

# configure terminal
# cd somewhere
# check
# attribute name "checkname"
# [set other attributes]
# no attribute disable
# exit
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/noit_conf_checks.c

    r5f388ee r7075a66  
    4343                           const char *arg) { 
    4444  uuid_t checkid; 
    45   char argcopy[1024], *target, *name; 
     45  char argcopy[1024], *target, *module, *name; 
    4646 
    4747  argcopy[0] = '\0'; 
     
    5353             argcopy); 
    5454  } 
    55   else if((name = strchr(argcopy, '`')) != NULL) { 
     55  else if((module = strchr(argcopy, '`')) != NULL) { 
    5656    noit_check_t *check; 
    5757    char uuid_str[37]; 
    5858    target = argcopy; 
    59     *name++ = '\0'; 
     59    *module++ = '\0'; 
     60    if((name = strchr(module+1, '`')) == NULL) 
     61      name = module; 
     62    else 
     63      name++; 
    6064    check = noit_poller_lookup_by_name(target, name); 
    6165    if(!check) { 
     
    133137    uuid_unparse_lower(out, outstr); 
    134138    xmlSetProp(newnode, (xmlChar *)"uuid", (xmlChar *)outstr); 
     139    xmlSetProp(newnode, (xmlChar *)"disable", (xmlChar *)"true"); 
    135140    rv = 0; 
    136141  } 
     
    636641          if(check) { 
    637642            busted = 0; 
    638             nc_printf(ncct, "%s`%s", check->target, check->name); 
     643            nc_printf(ncct, "%s`%s`%s", check->target, check->module, check->name); 
    639644          } 
    640645        }