SVC Manage

Overview

The svcmanage binary program allows users to execute all actions that would otherwise be performed via the N2SVCD management GUI. In situations where a user may not have browser access or the ability to connect to a remote machine this tool allows all management tasks to be performed via a command line environment. The default installation location for this binary is /usr/share/n2svcd/bin/n2svcd.

Running svcmanage --help will show the program usage.

usage:

    # Simple list of all applications.
    svcmanage [common-options]
    svcmanage [common-options] [--list]

    # Summary for all applications or a single application.
    svcmanage [common-options] --summary [<App-Name>]

    # Statistics for all applications or a single application.
    svcmanage [common-options] --statistics [<App-Name>]

    # Resource Drilldown for a specific configuration vector details.
    svcmanage [common-options] --configuration <App-Name> <Configuration-Key>

    # Resource Drilldown for a specific resource vector details.
    svcmanage [common-options] --resource <App-Name> <Resource-Key>

    # Configuration change an editable configuration value.
    svcmanage [common-options] [--set] <App-Name> <Configuration-Key> <New-Value>

    # Configuration create a new configuration vector.
    svcmanage [common-options] [--create-vector] <App-Name> <Configuration-Key> <New-Value-JSON>

    # Configuration update an editable configuration vector.
    svcmanage [common-options] [--update-vector] <App-Name> <Configuration-Key> <Vector-IDX> <New-Value-JSON>

    # Configuration remove an editable configuration vector.
    svcmanage [common-options] [--remove-vector] <App-Name> <Configuration-Key> <Vector-IDX>

    # [common-options]
        --date                          # Include Y-M-D for time/date fields.
        --host <rest-rpc-host>          Default = 'localhost'.
        --port <rest-rpc-port>          Default = 8088.
        --secure
        --user <username>
        --pass <password>

Common Options

The following common options may be specified with all svcmanage options.

Option Type Description
--date Switch By default all timestamps will only include time information. Specifying --date will format all timestamps to include date information.
--host String Specifying --host allows for the specification of a non standard REST RPC interface host.
Defaults to localhost
--port String Specifying --port allows for the specification of a non standard REST RPC interface port.
Defaults to 8088
--secure Flag Specifying --secure indicates that the REST RPC interface host should be contacted over HTTPS.
Defaults to not specified, i.e. HTTP is used.
--user String By default the N2SVCD management GUI does not require a username or password. If the application is running in a secure mode --user can be provided to specify a login username. If --user is specified `--pass` is required.
--pass String By default the N2SVCD management GUI does not require a username or password. If the application is running in a secure mode --pass can be provided to specify a login password. If --pass is specified `--user` is required.

Flag: --list

By default, svcmanage with no options will list all the available applications and their current status. This can be explicitly be invoked by passing the --list flag.

Example Usage

./svcmanage --list

====================================================================================================================================
MULTI-PROCESS[/n2svcd]: CONFIG = /etc/n2svcd/n2svcd.xml
====================================================================================================================================
IDX [PID  ] App-Name             Status       ADMIN IPC      USER IPC
 0: [30066] Watchdog             AVAILABLE    AQ 0/128k 0%   UQ 0/1m 0%
 1: [30067] Manage               AVAILABLE    AQ 0/1m 0%     UQ 0/1m 0%
 2: [30068] SOAP-SERVER          AVAILABLE    AQ 0/128k 0%   UQ 0/1m 0%
 3: [30069] REST-CLIENT          AVAILABLE    AQ 0/128k 0%   UQ 0/1m 0%
 4: [30070] DB-N2QD-MONGO        AVAILABLE    AQ 0/128k 0%   UQ 0/1m 0%
 5: [30071] DIAMETER-01          AVAILABLE    AQ 0/128k 0%   UQ 0/0g 0%
 6: [30072] DIAMETER-02          AVAILABLE    AQ 0/128k 0%   UQ 0/0g 0%
 7: [30073] Logic                AVAILABLE    AQ 0/128k 0%   UQ 0/1m 0%
====================================================================================================================================

Parameter: --summary

The --summary parameter will return a summary of all available applications, their current status, configuration scalars, vectors and resources.

By default, --summary will return a summary of all applications. If an argument is provided to it, then output is limited to the single named application that matches the provided application name.

Statistics that do not have any occurrence in any recorded (not displayed) statistics slice are not shown by default. Specifying the parameter --show-zero will show all statistics, regardless of value.

Note that statistics tags are ignored when displaying statistics.

--summary is assumed when svcmanage is executed with a single argument and no other output flag/parameter.

Example Usage

./svcmanage --summary Watchdog

====================================================================================================================================
MULTI-PROCESS[/n2svcd]: CONFIG = /etc/n2svcd/n2svcd.xml
====================================================================================================================================
IDX [PID   ] App-Name             Priority  Access   Load% Loading  ADMIN IPC      USER IPC       POLL
 0: [211767] Watchdog             PRIMARY   ONLINE      0% NORMAL   AQ 0/1m 0%     UQ 0/1m 0%     ACTIVE 0%

                <Config-Scalar>   <Value> <Set-Key|Type(|Hints)>
                       Priority = PRIMARY [priority_name|choice|DISASTER,FALLBACK,STANDBY,PRIMARY]
                      Quiescing = NO [quiescing|boolean]
               Alarm Clear Secs = 10 [alarm_clear_secs|integer|1-600]
                    High Load % = 70 [high_load_pc|integer|1-100]
         Statistics Slice Count = 60 [stats_slice_count|integer|1-1000]
       Statistics Slice Seconds = 5 [stats_slice_secs|integer|1-600]
   Overloaded Poll MS Threshold = 100 [overloaded_poll_ms|integer|1-10000]
 Overloaded Active MS Threshold = 500 [overloaded_active_ms|integer|1-50000]
           Shutdown Notice Secs = 0 [shutdown_notice_secs|integer|1-60]
          Termination Notice MS = 500 [termination_notice_ms|integer|100-5000]
              Heartbeat Seconds = 30 [heartbeat_interval_secs|integer|0-600]
          Heartbeat Response MS = 1000 [heartbeat_response_ms|integer|100-5000]

                 <Config-Vector>   <Count> <Drilldown-Key>
 Application Specific Heartbeats = 0 [application_specific_heartbeats]

 <Resource-Scalar>   <Count>
 Timeouts (Active) = 1
  Timeouts (Total) = 0

 <Statistic-Counter>  13:56:35  13:56:30  13:56:25
     heartbeat.check         0         1         0
   heartbeat.success         0         1         0

====================================================================================================================================

Parameter: --do

–do is used to request applications to perform a single supported action. Please contact N-Squared Support if further details are required.

An application name must be provided for this operation. The action may be sent to multiple applications identified by prefix by specifying the prefix followed by *.

No output (other than success/failure indication) is shown by svcmanage. Any output from the action will be shown in the N2SVCD log.

Parameter: --statistics

The --statistics parameter will return aggregated time sliced statistics for all available applications.

By default, --statistics will return a summary of all applications. If an argument is provided to it, then output is limited to the single named application that matches the provided application name. Applications may also be identified by prefix by specifying the prefix followed by *.

Statistics that do not have any occurrence in any recorded (not displayed) statistics slice are not shown by default. Specifying the parameter --show-zero will show all statistics, regardless of value.

Note that statistics tags are ignored when displaying statistics.

Statistic timing measurements are output in the format X@m-M/A, where:

Example Usage

./svcmanage --statistics Watchdog

====================================================================================================================================
MULTI-PROCESS[/n2svcd]: CONFIG = /tmp/n2svcd.xml
====================================================================================================================================
====================================================================================================================================
                                                               Watchdog
====================================================================================================================================
Statistics Counters
====================================================================================================================================
        Time    heartbeat    heartbeat
                    check      success
    10:57:55            1            1
    10:58:00            0            0
    10:58:05            0            0
====================================================================================================================================

Parameter: --configuration

The --configuration parameter is used to view all the configured vectors for a named application and configuration key. Information on available configuration vector keys can be obtained via the <Drilldown-Key> information block provided by the application --summary parameter.

Parameters

Parameter Type Description
App-Name String [Required] The named application to retrieve configuration information for.
Configuration-Key String [Required] The named configuration vector to retrieve configuration information for.
Configuration-Id Integer Filter results to a single configuration vector ID.
Vector-Column String Filter results to a single configuration vector column.

Example Usage

./svcmanage --configuration SOAP-SERVER trace_traps

====================================================================================================================================
APPLICATION [SOAP-SERVER], CONFIGURATION [trace_traps], 1 ITEM(S)

EXAMPLE VECTOR JSON: {"arg_name":"<value>","trace_level":"<value>","soap_action":"<value>","arg_re":"<value>"}

IDX SOAP Action    Arg Name        Arg RE trace
0   do_soap_action unique_id_field 1234   1
====================================================================================================================================

Parameter: --resource

The --resource parameter is used to view all of the resources associated with a named application and resource key. Information on the available resource keys can be obtained via the information block provided by the application --summary parameter.

Parameters

Parameter Type Description
App-Name String [Required] The named application to retrieve resource vector information for.
Resource-Key String [Required] The named resource vector to retrieve information for.
Resource-Id Integer Filter results to a single resource vector ID.
Vector-Column String Filter results to a single resource vector column.

Example Usage

./svcmanage --resource DIAMETER-01 client_connections

====================================================================================================================================
APPLICATION [DIAMETER-01], RESOURCE [client_connections], 1 ITEM(S)

Name          Local Host Local Port Remote Host Remote Port FD FD Ready Login OK Send Req? Recv Req? #Jobs Active Connect Attempt@ Ping-IN
DIAMETER-01-1 127.0.0.1  42756      127.0.0.1   3868        4  1        1        1         0         0            00:54:02.26      21/21
====================================================================================================================================

Parameter: --set

–set is used to set the value of a single editable configuration scalar. Information on the available configurable scalars can be obtained via the information block provided by the application --summary parameter.

An application name must be provided for this operation. The operation may be sent to multiple applications identified by prefix by specifying the prefix followed by *.

When updating a configuration scalar, values are checked against constraints set by the item being updated. If these constraints are not satisfied, the update will fail.

Parameters

Parameter Type Description
App-Name String [Required] The named application to set a single configuration scalar on.
Configuration-Key String [Required] The named configuration scalar to set.
New-Value (various)) [Required] The value to update the configuration scalar with.

Example Usage

./svcmanage --summary SOAP-SERVER

    ...
    <Config-Scalar>   <Value> <Set-Key|Type>
    Trace Level (Max) = 1
    Trace Level = 0 [trace_level|0,1]
    ...
./svcmanage --set SOAP-SERVER trace_level 1

UPDATE SUCCESSFUL
./svcmanage --summary SOAP-SERVER

    ...
    <Config-Scalar>   <Value> <Set-Key|Type>
    Trace Level (Max) = 1
    Trace Level = 1 [trace_level|0,1]
    ...

Parameter: --create-vector

The --create-vector parameter is used to create a new configuration vector. Information on the available configurable vectors can be obtained via the information block provided by the application --summary parameter.

Additional information on vector creation is provided by the --configuration parameter.

When creating a configuration vector, values are checked against constraints set by the vector. If these constraints are not satisfied, the creation will fail.

An application name must be provided for this operation. The operation may be sent to multiple applications identified by prefix by specifying the prefix followed by *.

Parameters

Parameter Type Description
App-Name String [Required] The named application to create a configuration vector on.
Configuration-Key String [Required] The named configuration vector for which an entry will be created.
New-Value JSON [Required] The JSON definition of the values that will be created for the configuration vector. See `--configuration` for information.

Example Usage

./svcmanage --summary SOAP-SERVER

    ...
    <Config-Vector>   <Count> <Drilldown-Key>
    Handlers = 1 [handlers]
    Trace Traps = 1 [trace_traps]
    ...
./svcmanage --configuration SOAP-SERVER trace_traps

====================================================================================================================================
APPLICATION [SOAP-SERVER], CONFIGURATION [trace_traps], 1 ITEM(S)

EXAMPLE VECTOR JSON: {"soap_action":"<value>","arg_name":"<value>","arg_re":"<value>","trace_level":"<value>"}

IDX SOAP Action    Arg Name        Arg RE trace
0   do_soap_action unique_id_field 1234   1
====================================================================================================================================
./svcmanage --create-vector SOAP-SERVER trace_traps '{"soap_action":"create","arg_name":"vector","arg_re":"1234","trace_level":"1"}'

VECTOR CREATION SUCCESSFUL
./svcmanage --configuration SOAP-SERVER trace_traps

====================================================================================================================================
APPLICATION [SOAP-SERVER], CONFIGURATION [trace_traps], 2 ITEM(S)

EXAMPLE VECTOR JSON: {"arg_name":"<value>","soap_action":"<value>","arg_re":"<value>","trace_level":"<value>"}

IDX SOAP Action    Arg Name        Arg RE trace
0   do_soap_action unique_id_field 1234   1
1   create         vector          1234   1
====================================================================================================================================

Parameter: --update-vector

The --update-vector parameter is used to update an existing editable configuration vector. Information on the available vectors is provided by the --configuration parameter.

When updating a configuration vector, values are checked against constraints set by the vector. If these constraints are not satisfied, the update will fail.

An application name must be provided for this operation. The operation may be sent to multiple applications identified by prefix by specifying the prefix followed by *.

Parameters

Parameter Type Description
App-Name String [Required] The named application to update a configuration vector on.
Configuration-Key String [Required] The named configuration vector for which an entry will be update.
Vector-IDX Number [Required] The index of the vector within the list of configured vectors to update. See `--configuration` for information.
New-Value JSON [Required] The JSON definition of the values that will be updated for the configuration vector. See `--configuration` for information.

Example Usage

./svcmanage --configuration SOAP-SERVER trace_traps

====================================================================================================================================
APPLICATION [SOAP-SERVER], CONFIGURATION [trace_traps], 2 ITEM(S)

EXAMPLE VECTOR JSON: {"arg_name":"<value>","soap_action":"<value>","arg_re":"<value>","trace_level":"<value>"}

IDX SOAP Action    Arg Name        Arg RE trace
0   do_soap_action unique_id_field 1234   1
1   create         vector          1234   1
====================================================================================================================================
./svcmanage --update-vector SOAP-SERVER trace_traps 1 '{"soap_action":"updated","arg_name":"vector","arg_re":"1234","trace_level":"1"}'

VECTOR UPDATE SUCCESSFUL
./svcmanage --configuration SOAP-SERVER trace_traps

====================================================================================================================================
APPLICATION [SOAP-SERVER], CONFIGURATION [trace_traps], 2 ITEM(S)

EXAMPLE VECTOR JSON: {"arg_name":"<value>","arg_re":"<value>","soap_action":"<value>","trace_level":"<value>"}

IDX SOAP Action    Arg Name        Arg RE trace
0   do_soap_action unique_id_field 1234   1
1   updated        vector          1234   1
====================================================================================================================================

Parameter: --remove-vector

The --remove-vector parameter is used to remove an existing editable configuration vector. Information on the available vectors is provided by the --configuration flag.

An application name must be provided for this operation. The operation may be sent to multiple applications identified by prefix by specifying the prefix followed by *.

Parameters

Parameter Type Description
App-Name String [Required] The named application to remove a configuration vector on.
Configuration-Key String [Required] The named configuration vector for which an entry will be removed.
Vector-IDX Number [Required] The index of the vector within the list of configured vectors to remove. See `--configuration` for information.

Example Usage

./svcmanage --configuration SOAP-SERVER trace_traps

====================================================================================================================================
APPLICATION [SOAP-SERVER], CONFIGURATION [trace_traps], 2 ITEM(S)

EXAMPLE VECTOR JSON: {"arg_name":"<value>","soap_action":"<value>","arg_re":"<value>","trace_level":"<value>"}

IDX SOAP Action    Arg Name        Arg RE trace
0   do_soap_action unique_id_field 1234   1
1   updated         vector          1234   1
====================================================================================================================================
./svcmanage --remove-vector SOAP-SERVER trace_traps 1

VECTOR REMOVAL SUCCESSFUL
./svcmanage --configuration SOAP-SERVER trace_traps

====================================================================================================================================
APPLICATION [SOAP-SERVER], CONFIGURATION [trace_traps], 2 ITEM(S)

EXAMPLE VECTOR JSON: {"arg_name":"<value>","arg_re":"<value>","soap_action":"<value>","trace_level":"<value>"}

IDX SOAP Action    Arg Name        Arg RE trace
0   do_soap_action unique_id_field 1234   1
====================================================================================================================================