Configurations

Daemon configurations

Knock daemon configurations are located in /etc/knock/knockdaemon/

File /etc/knock/knockdaemon/knockdaemon.ini

This is the main configuration file (ini format).

Note : we may move to json in future releases.

Important : Specifying agressive values, like for http_send_min_interval_ms or exec_interval_sec, is definitively not allowed. Shipped values are nominal; aggressive values may overload our infrastructure and may force us to shut your namespace.

Section [knockd]

  • exectimeout_ms
    Integer. Probe execution timeout in millis.
    Keep shipped value.

Section [transport]

  • class_name
    String. Class name of Transport implementation.
    Keep shipped value.
  • http_uri :
    String. Target api uri.
    Keep shipped value.
  • http_send_min_interval_ms
    Integer. Minimal send interval in millis.
    Keep shipped value.
  • http_send_max_bytes
    Integer. Maximal send bytes in a single http call.
    Keep shipped value.
  • lifecycle_interval_ms
    Integer. Lifecycle log interval in millis.
    Set to 30000 by default.

Sections [knock_PROBE_NAME]

Note : PROBE_NAME is replaced by probe unique name (knock_Memory, knock_Load and so on).

Note : If a probe implementation is not specified in sections below, it has no specific configuration other than common items..

Common properties for all probes :

  • class_name
    String. Class name of probe implementation.
    Example: "knockdaemon.Probes.Os.Memory.Memory".
    Keep shipped values.
  • exec_interval_sec
    Integer. Execution interval in seconds.
    Keep shipped values.
  • exec_enabled
    Boolean. True if probe execution is enabled.
    Keep shipped values.

Section [knock_CheckProcess]

  • process_json_configfile
    String. Full path to CheckProcess json configuration file.
    Example: "/etc/knock/knockdaemon/k.CheckProcess.json"
    Json buffer sample, which monitor "knockdaemon" process, if "startup" file is present, and uses specified "pid" file.
    Do not remove or modify "knockdaemon".
    {
        "knockdaemon": {
            "startup": "/etc/init.d/knockdaemon",
            "pid": "/var/run/knockdaemon.pid"
        }
    }

Section [knock_CheckDns]

  • dns_host
    Formatted string : "domain0, ..., domainN".
    List of domains for which dns resolving must be monitored.
    Example :
    dns_host = www.google.com,api.knock.center

Section [knock_Apache]

  • url
    Formatted string : "url0|...|urlN".
    List of apache status uris. First uri which return a valid apache server status buffer win.
    Example :
    url = http://127.0.0.1:80/server-status|http://127.0.0.1:8080/server-status|http://127.0.0.1:8090/server-status

Section [knock_Nginx]

  • url
    Formatted string : "url0|...|urlN".
    List of nginx status uris. First uri which return a valid nginx server status buffer win.
    Example :
    url = http://127.0.0.1:80/nginx_status|http://127.0.0.1:8080/nginx_status|http://127.0.0.1:8090/nginx_status

Section [knock_PhpFpm]

  • url0 to urlN
    List of formatted string, one for each php pool. String format : "fpm_pool_id|url0|...|urlN".
    For each pool, first uri which return a valid php fpm status buffer win.
    Note : fpm_pool_id must be a valid php pool as defined in /etc/php5/fpm/pool.d/*.conf files
    Example :
    url0 = www_a|http://127.0.0.1:80/status|http://127.0.0.1:80/phpfpm-status|http://127.0.0.1:80/php5fpm-status
    url1 = www_b|http://127.0.0.1:81/status|http://127.0.0.1:81/phpfpm-status|http://127.0.0.1:81/php5fpm-status

Section [knock_Netstat]

  • ping_target_server
    String.
    Target server to ping and compute ping delay.
    Example :
    ping_target_server = 127.0.0.1

Section [knock_TimeDiff]

  • time_target_server
    String.
    Target server for time difference computation using ntp.
    Example :
    time_target_server = 2.pool.ntp.org
  • time_http_target_server
    String.
    Target server for time difference computation using http (used as fallback for ntp).
    Keep shipped value.
    Example :
    time_http_target_server = https://api.knock.center/

File /etc/knock/knockdaemon/conf.d/10_auth.ini

The configuration file specifying your namespace and it associated namespace key (ini format).

Keep this file private.

Section [knockd]

  • acc_namespace
    String.
    Knock namespace.
    Example :
    acc_namespace = foocompany
  • acc_key
    String.
    Knock api key.
    Example :
    acc_key = FOOAPIKEY