Skip to content

Using the Administration Utility

Gurpartap edited this page Dec 21, 2012 · 7 revisions

Cognizant can be administered using the cognizant command line utility. This is an application for performing administration tasks like monitoring, starting, stopping processes or loading configuration and processes' information.

Here are some basic operational commands:

$ cognizant monitor redis # by group name
$ cognizant restart redis-server-1 # by process name

To get cognizant to ignore a particular process' (or group's) state:

$ cognizant unmonitor sleep

Now check status of all managed processes:

$ cognizant status
+----------------+-------+--------------------------------------+-------+-------+---------+
| Process        | Group | State                                | PID   | % CPU | Memory  |
+----------------+-------+--------------------------------------+-------+-------+---------+
| redis-server-1 | redis | running since 1 minute               | 23442 | 10.70 | 3.7 MB  |
+----------------+-------+--------------------------------------+-------+-------+---------+
| redis-server-2 | redis | running since 2 minutes              | 23444 | 0.0   | 1.7 MB  |
+----------------+-------+--------------------------------------+-------+-------+---------+
| sleep          |       | unmonitored since less than a minute |       | 0.0   | 0 Bytes |
+----------------+-------+--------------------------------------+-------+-------+---------+
2012-11-23 01:16:18 +0530

Available options and commands for cognizant are:

$ cognizant --help

NAME
    cognizant - administration utility for cognizantd

SYNOPSIS
    cognizant [GLOBAL OPTIONS] COMMAND [ARGUMENTS...]

GLOBAL OPTIONS
    -s, --socket FILE          The socket lock file of the daemon server (default: /var/run/cognizant/cognizantd.sock)
    -b, --bind-address ADDR    The server address of the daemon server (default: none)
    -p, --port PORT            The server port of the daemon server (default: none)
        --username USERNAME    Username to use for authentication with server (default: none)
        --password PASSWORD    Password to use for authentication with server (default: none)
    -v, --version              Print the version number and exit
    -t, --trace                Turn on tracing, enabling full backtrace
        --help                 Show this message

COMMANDS
    help [COMMAND]    Shows a list of commands or help for one command
    status [NAME]     Display status of managed process(es) or group(s)
    load FILE         Loads the process information from specified Ruby file
    monitor NAME      Monitor the specified process or group
    unmonitor NAME    Unmonitor the specified process or group
    start NAME        Start the specified process or group
    stop NAME         Stop the specified process or group
    restart NAME      Restart the specified process or group
    shutdown          Stop the monitoring daemon without affecting processes