Creates new tests for an existing device.
test.create "deviceName=<new_name>"
, "testType=<ping | snmp | port | external | composite | ...>"
, "subType=<based on testType>"
, "testName=<test name displayed on screen>"
, "warningThreshold=<value>", "criticalThreshold=<value>"
, "units=<string>"
, "resultMultiplier=<number>"
, "resultProcessDirective=<see table below>"
, "maxValue=<number>"
[, "actionName=<new_value>"]
Some of the parameters are specific to each test type. For a detailed list of commands and different test types, type help test.create
.
Shared Credentials
Creating a new test via BVE API now automatically uses existing shared monitor configurations (credentials) when applicable.
For example, create a shared credential—wmi, snmp, vmware—in a department. Then identify device that could be provisioned with a test using that credential.
Use test.create
on the device without providing any credentials. An example command is:
./bveCLI.pl --host n.n.n.n --user 195085 --pass something --exec "Test.create 'criticalthreshold=7500','devicename=IP_10.20.70.32_195085','maxvalue=0','resultmultiplier=1.0','resultprocessdirective=0','subtype=host_thread_count','testname=Number Of Threads_cli','testtype=wmi','units=threads','warningthreshold=5000','wmiProperty=\\\\\Win32_PerfRawData_PerfOS_System:Threads:@'"
The first shared config of testtype is automatically assigned to this test and this test gets provisioned.
Credentials
Depending on the type of test being created, authentication credentials can be specified using (optional) loginName and password parameters.
If there is an existing shared credential with matching login ID and password already exists, it will be used. Otherwise a new shared credential will be created automatically.
If credentials are required but none is specified, the first shared credential of that test type within the department will be used.
resultProcessDirective
Indicates what type of calculation to perform after polling the new value. For example, when it is set to percent
, the polled value and maximum (configured) value are used to calculate percentage, which is the final result.
resultProcessDirective Values |
Value |
Description |
0 |
NONE. |
No post processing is done on the result |
1 |
PERCENT. |
The fetched value is divided by the provisioned maximum value to get the percent. Useful for disk utilization. |
2 |
DELTA. |
Calculate the difference between the value retrieved in the previous test and the value retrieved in the current test. |
3 |
RATE. |
Calculate the delta from the previous value and then divide by the time interval between the tests to calculate the rate per second. |
4 |
DELTAPERCENT. |
Calculate the delta from the previous value, and then divide by the provisioned maximum value. |
5 |
RATEPERCENT. |
Calculate the delta from the previous value, and then divide by the time interval between tests as well as the provisioned maximum value to get the percentage per second. |
6 |
REVPERCENT. |
Calculate the `percent' and then subtract from 100 to get the `reverse'. Useful to convert disk full into disk free. |
7 |
STRHEX2LONG. |
Convert opaque hexadecimal strings to long (e.g. in Amperion BPC equipment). |
8 |
TIMETICKS. |
Convert number of milliseconds since midnight Jan 1, 1970 into dd hh:mm:ss format. |
resultMultiplier
Allows you to modify the polled result. If the SNMP agent reports data in bytes, and you want use bits, set the resultMultiplier
to 8. To convert KB into MB, the resultMultiplier
will be 0.001. As another example, you can also multiply by 60 to convert rate from per second to per minute.
Traverse only supports integer values for polled results, so the results are rounded off before they are stored in the database. You can use resultMultiplier
to bypass this restriction. For example, if you need to monitor values up to two significant digits for load average, modify the test and enter 100 as the resultMultiplier
value. You would need to update the thresholds accordingly (i.e. multiply them by 100). Note that resultMultiplier
is only applicable for SNMP and "external" tests.
maxValue
This is the maximum post-processed value (not the max of the SNMP counter/gauge which is typically 2^32). So, if you are measuring the traffic rate of an ethernet port, which has a test unit of Kbps, the max value should be 10,000. When measuring disk space utilization, it holds the maximum size for the disk (partition) as reported by the SNMP agent, which will be used for percentage calculation. For creating a ping test
test.create "deviceName=<new_value>"
, "testType=ping"
, "subType=<pl|rtt>"
, "testName=<new_value>"
[, "interval=<new_value>"]
[, "warningThreshold=<new_value>"]
[, "criticalThreshold=<new_value>"]
[, "actionName=<new_value>"]
Example:
test.create "deviceName=Cisco Router 01", "testType=ping", "subType=rtt",
"testName=Cisco-Router-01-ping-rtt", "warningThreshold=250",
"criticalThreshold=1500", "actionName=email-NOC"
Creating an SNMP test
test.create "deviceName=<new_value>"
, "testType=snmp"
, "subType=<new_value>"
, "testName=<new_value>"
[, "interval=<new_value>"]
[, "warningThreshold=<new_value>"]
[, "criticalThreshold=<new_value>"]
, "snmpOId=<new_value>"
, "resultMultiplier=<new_value>"
, "resultProcessDirective=<new_value>"
, "maxValue=<new_value>"
[, "actionName=<new_value>"]
Creating a port test:
test.create "deviceName=<new_value>"
, "testType=port"
, "subType=<http|https|smtp|pop3|pop3s|imap|imaps|nntp|ftp|advanced>"
, "testName=<new_value>"
[, "interval=<new_value>"]
[, "warningThreshold=<new_value>"]
[, "criticalThreshold=<new_value>"]
[, "port=<new_value>"]
[, "url=<new_value>"]
[, "loginName=<new_value>"]
[, "password=<new_value>"]
[, "actionName=<new_value>"]
[, "sendString=<new_value>"]
[, "expectString=<new_value>"]
Creating an external test:
test.create "deviceName=<new_value>"
, "testType=external"
, "testName=<new_value>"
, "interval=<new_value>"
, "warningThreshold=<new_value>"
, "criticalThreshold=<new_value>"
[, "actionName=<new_value>"]
Creating a JMX test:
test.create "devicename=<new_value>"
,"testType=jmx"
,"subtype=<new_value>
,"testName=<new_value>"
,"jmxProperty=NetVigil:name=Source\,type=syslogd/514|MessagesReceived"
Note: Please note that escape character '\' should be added before '|' and ',' if they are parts of a parameter value.