Previous Topic: svcwatch add snmp Command--Add an SNMP TestNext Topic: svcwatch add tcpconnect Command--Add a TCP Connect Test


svcwatch add sql Command--Add an SQL Test

The svcwatch add sql command adds a SQL test to SRM on the specified host. For details and prerequisites, see SQL Query Tests in this guide.

This command has the following format:

svcwatch [options] -o add index descr sql destination 
username password args interval samples timeout winsiz tos 
limit flags name class contextInfo logLevel

The add command uses the following parameters:

options

Specifies the possible options for this command.

-h hostname | -h ipAddr

(Optional) Specifies the SystemEDGE host.

Default: localhost

-p port

(Optional) Specifies the SystemEDGE SNMP port.

Default: 161

-c community

(Optional) Specifies the SNMP community string for SNMP version 1 and 2c.

Default: public

-v snmpVersion

(Optional) Specifies the SNMP version. Possible values are:

  • 1
  • 2c
  • 3

Default: 1

-u secName

(Optional) Specifies the name of the SNMPv3 secure user.

-u secLevel

(Optional) Specifies the level of security for SNMPv3. Possible values are:

  • 1 – noAuthNoPriv
  • 2 – AuthNoPriv
  • 3 – AuthPriv
-n contextName

(Optional) Specifies the instance name for a MIBMuxed agent.

-a authPassword

(Optional) Identifies the authentication password required when SNMPv3 is selected with security AuthNoPriv or AuthPriv.

-A authProtocol

(Optional) Specifies the authentication protocol. Possible values are:

  • MD5 – authentication protocol HMAC-MD5
  • SHA – authentication protocol HMAC-SHA

Default: MD5

-x privPassword

(Optional) Specifies the privacy (encryption) password for SNMPv3 with security level 3 (AuthPriv).

-X encryptProtocol

(Optional) Specifies the use of encryption protocol for privacy. Possible values are:

  • DES – Data Encryption Standard
  • AES – Advanced Encryption Standard using cryptographic keys of 128 bits (AES128)
  • 3DES – Triple Data Encryption Standard
-m FIPSmode

(Optional) Specifies the FIPS mode. Possible values are:

  • 0 – non-FIPS
  • 1 – FIPS coexistence
  • 2 – FIPS only

Default: 0

-t timeout

(Optional) Specifies the SNMP command timeout.

Default: 10 seconds

-d logLevel

(Optional) Specifies the log level for SNMP messages. Possible values are:

  • 0 – log fatal messages
  • 1 – log critical messages
  • 2 – log warning messages
  • 3 – log information messages
  • 4 – log all messages
  • 5 – log all messages including debugging messages

Default: 0

-f logFile

(Optional) Specifies the name of the logfile.

Default: sysedge_utility.log

-L

(Optional) Detects the current locale of the console and language catalog if available. If a language catalog is not found, the utility falls back to English as a default language.

-o add testparams

Adds a new test to SRM.

testparams

Specifies the parameters for the new test.

index

Specifies the svcRspTable index.

descr

Specifies the description of the test in quotes. An empty string in quotes "" specifies no description.

sql

Specifies the SQL service type.

destination

Specifies the database server and port (server:port) for the test. Default ports: 1433 (SQL Server), 1521 (Oracle)

username

Specifies the user name for authentication in quotes. An empty string in quotes "" specifies no user name.

password

Specifies the password for authentication in quotes. An empty string in quotes "" specifies no password.

args

Specifies the service arguments. Each argument is a pair of a keyword and a value (key=value). Multiple arguments are concatenated and delimited by ampersands (&). The complete arguments string is enclosed in quotes.

General syntax for arguments: "key1=value1[&key2=value2& ...]"

query=query - Specifies the SQL query.

qtype=query|stored|update - (Optional) Specifies the query type (Default: query)

dbtype=oracle|mssql|other - Specifies the database type.

dbname=name - (oracle and mssql only) Specifies the database name. When you select "other", specify the database name in the connect string.

driver=driver - (other only) The JDBC driver to use for the query.

url=string - (other only) The database connect string; varies by database type. For information about connect strings, refer to your database documentation.

Note: For details of the particular arguments for each service type, see Keywords for Tests.

interval

Specifies the test interval in seconds.

Limits: multiple of 30 seconds

samples

Specifies the samples per interval.

timeout

Specifies the timeout in seconds.

winsiz

Specifies the statistics window size in seconds.

tos

Specifies the IP Type of Service or Differentiated Services Code. Use 0 (zero) for a normal service. See also RFC 1349.

limit

Specifies the acceptable performance limit (or threshold) for the total response time of this test. This value is used in reports.

flags

Specifies the following flags:

0x001 = collect performance cubes

0x100 = execute on request only (run once)

name

Specifies the unique name per service type. An empty string in quotes "" specifies no test name.

class

Specifies the class name. An empty string in quotes "" specifies no class name.

contextInfo

Specifies context information. An empty string in quotes "" specifies no context information.

logLevel

Specifies the log level for the test execution code. Possible values are:

-2 = use SRM-global log level (default)

-1 = do not log

0 = fatal (only the most important messages)

1 = critical

...

7 = debug3 (log all messages)

Examples

Adding a SQL server test:

svcwatch -p 161 -c admin -o add 1360758 "TestSqlServer" sql 
"192.168.100.100:1433" "sa" "AdminLvl1" "query=select * from 
vas_system&dbtype=mssql&dbname=vasdb" 30 3 30 60 0 0 0x100 
"TestSQL" "" ""

Adding a SQL server JDBC driver test:

svcwatch -p 161 -c admin -o add 1360761 "TestSqlServerJDBCDriver"
sql "192.168.100.100:1433" "sa" "AdminLvl1" "query=select * from 
my_system&dbtype=other&driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
&url=jdbc:sqlserver://hostnameValue:portValue;databaseName=vasdb;
user=unameValue;password=pwdValue" 30 3 30 60 0 0 0x100 
"TestSqlServerJDBCDriver" "" ""

Adding an Oracle test:

svcwatch -p 161 -c admin -o add 1360759 "TestOracle" sql 
"192.168.101.101:1521" "joe" "AdminLvl1" "query=select * from big_system
&dbtype=oracle&dbname=bigdb" 30 3 30 60 0 0 0x100 "TestOracle" "" ""

Adding an Oracle JDBC Thin Driver test:

svcwatch -p 161 -c admin -o add 1360762 "TestOracleJDBCThinDriver" sql 
"192.168.101.101:1521" "joe" "AdminLvl1" "query=select table_name from 
user_tables&dbtype=other&driver=oracle.jdbc.OracleDriver
&url=jdbc:oracle:thin:unameValue/pwdValue@hostnameValue:portValue:orcl" 
30 3 30 60 0 0 0x100 "TestOracleThin" "" ""

More Information

SQL Query Tests

Keywords for Tests