cimsub usage information
You can use this command to manage CIM indication subscriptions on the local CIM Server. A symbolic link in the /QOpenSys/usr/bin directory for this command is provided. You need to ensure that CIMOM is running when you use this command. This command requires *ALLOBJ and *IOSYSCFG authorities to manage certificates.
- Name
- cimsub
Create, enable, disable, or remove a subscription, display selected subscription information, as well as create, remove, and display filters and handlers.
- Synopsis
- Usage:
cimsub -c f [fnamespace:]filtername -Q query [-L querylanguage] [-N sourcenamespace]
cimsub -c h [hnamespace:][hclassname.]handlername [-D destination]| [-T snmptargethost [-P snmpportnumber] -V snmpversion [-S snmpsecurityname] [-E snmpengineid]]
cimsub -c s [-n namespace] -F [fnamespace:]filtername -H [hnamespace:][hclassname.]handlername
cimsub -l s|f|h [-v] [-n namespace] [-F [fnamespace:]filtername] [-H [hnamespace:][hclassname.]handlername]
cimsub -e [-n namespace] -F [fnamespace:]filtername -H [hnamespace:][hclassname.]handlername
cimsub -d [-n namespace] -F [fnamespace:]filtername -H [hnamespace:][hclassname.]handlername
cimsub -r s|f|h|a [-n namespace] [-F [fnamespace:]filtername] [-H [hnamespace:][hclassname.]handlername]
cimsub --help
cimsub --version
- Description
- The cimsub command provides a command line
interface to manage CIM indication subscriptions on the local CIM
Server.
- The first three forms of the cimsub command create the specified subscription, filter, handler, or subscription and its referenced filter and handler.
- The fourth form of the cimsub command lists all or selected indication subscriptions, filters, or handlers, and displays the requested information about the instance(s).
- The fifth form of the cimsub command enables the specified subscription, i.e. the subscription instance is modified to set the value of the SubscriptionState property to Enabled. When a subscription is enabled, the CIM Server attempts to process the subscription if at least one provider is available to serve the subscription.
- The sixth form of the cimsub command disables the specified subscription, i.e. the subscription instance is modified to set the value of the SubscriptionState property to Disabled. When a subscription is disabled, the CIM Server does not attempt to process the subscription, regardless of whether any providers are available to serve the subscription.
- The seventh form of the cimsub command removes the specified subscription, filter, handler, or subscription and its referenced filter and handler, i.e. each instance is deleted from the repository, and the CIM Server will no longer have any information about the instance(s). A filter or handler may not be removed if it is referenced by any other subscription.
- Options
- -c
- Create specified subscription, filter, and handler (CIM_ListenerDestinationCIMXML, if not specified hclassname).
- -l
- List and display information about all or selected indication subscriptions ("s"), filters ("f"), or handlers ("h"). It is an error to specify the -F option with -lh. It is an error to specify the -H option with -lf. With the -lf or -lh option, fnamespace or hnamespace takes precedence over the -n namespace option if both are specified.
- -e
- Enable the specified subscription (set the SubscriptionState to Enabled).
- -d
- Disable the specified subscription (set the SubscriptionState to Disabled).
- -r
- Remove the specified subscription ("s"), filter ("f"), handler ("h"), or subscription and its referenced filter and handler ("a") (delete the instance(s) from the repository). The -F and -H options are required with -rs or -ra. It is an error to specify the -F option with -rh. It is an error to specify the -H option with -rf. With the -rf or -rh option, fnamespace or hnamespace takes precedence over the -n namespace option if both are specified.
- -v
- Include verbose information (e.g. SubscriptionState value, filter query, handler destination) in the information displayed for each listed instance.
- -n namespace
- Specify the namespace. For the -l forms of the command, if no namespace is specified, instances in all namespaces are listed. For all other forms of the command, if no namespace is specified, the command operates on an instance in the namespace root/PG_InterOp.
- -F [fnamespace:]filtername
- Specify the Filter Name. Omission of the filter namespace specifies that it is the same as that of the subscription.
- -H [hnamespace:][hclassname.]handlername
- Specify the Handler Name. Omission of the handler namespace specifies that it is the same as that of the subscription. Omission of the handler classname specifies that it is CIM_ListenerDestinationCIMXML.
- --help
- Display the help message.
- --version
- Display the CIM Server version.
- Remarks
- The cimsub command requires that the CIM Server is running
- Exit Status
- When an error occurs, an error message is written to stderr, and
an error value is returned. The following values are returned:
0 Success 1 General error 2 Connection failed 3 Connection timeout 4 Access was denied 5 Namespace does not exist 6 Object could not be found 7 Operation is not supported - Usage Notes®
- The cimsub command requires the CIM server to be running. If the configuration property enableSubscriptionsForNonprivilegedUsers is set to false, only a privileged user may list, enable, disable, or remove a subscription, filter, or handler. If the nableSubscriptionsForNonprivilegedUsers configuration property is set to true, only a privileged user or the instance creator may enable, disable, or remove a subscription, filter, or handler. Caution should be used when specifying the -r option, since subscriptions, filters, or handlers removed may not be easily re-created, and may not be re-created using this command.
Examples
- cimsub -cf test/TestProvider:filter1 -Q 'select * from IBMi_CacheBatteryEvent where DaysToError < 55'
- Create a filter. The -Q option specifies the select condition for the event.
- cimsub -ch root/ibmsd:handler1 -D https://ServerName:Port/CIMListener/DirectorConsumer
- Create a handler. The -D option indicates where the event should be sent.
- cimsub -cs -n root/ibmsd -F test/TestProvider:filter1 -H test/TestProvider:handler1
- Create a subscription. The user should have the listener available to wait for the event. The event is organized as a CIM instance and the user can pick up properties from the instance.
- cimsub –ls
- List all indication subscriptions in all namespaces on the local CIM Server.
- cimsub -ls -F TestFilter
- List all indication subscriptions referencing the Filter with Name TestFilter in all namespaces on the local CIM Server.
- cimsub -ls -H TestHandler
- List all indication subscriptions referencing the CIM_ListenerDestinationCIMXML Handler with Name TestHandler in all namespaces on the local CIM Server.
- cimsub -ls -v -n root/cimv2
- List all indication subscriptions in the root/cimv2 namespace on the local CIM Server, including subscription state, filter query and handler destination (verbose listing output).
- cimsub -ls -v -n root/PG_InterOp -F TestFilter -H TestHandler
- Display information about the subscription referencing Filter with Name TestFilter and referencing CIM_ListenerDestinationCIMXML Handler with Name TestHandler (all in namespace root/PG_InterOp), including subscription state, filter query, and handler destination (verbose listing output).
- cimsub -lf -v -F root/cimv2:TestFilter
- Display information about the Filter with Name TestFilter in the root/cimv2 namespace (verbose listing output).
- cimsub –lh
- IList all handlers in all namespaces on the local CIM Server.
- cimsub -e -F TestFilter -H TestHandler
- Enable the subscription referencing Filter with Name TestFilter and referencing CIM_ListenerDestinationCIMXML Handler with Name TestHandler (all in namespace root/PG_InterOp).
- cimsub -d -n root/cimv2 -F test1/cimv2:TestFilter -H test2/cimv2:PG_ListenerDestinationSystemLog.TestHandler
- Disable the subscription in namespace root/cimv2, referencing Filter with Name TestFilter in namespace test1/cimv2, and referencing PG_ListenerDestinationSystemLog Handler with Name TestHandler in namespace test2/cimv2.
- cimsub -ra -n root/cimv2 -F TestFilter -H TestHandler
- Remove the subscription referencing Filter with Name TestFilter, and referencing CIM_ListenerDestinationCIMXML Handler with Name TestHandler (all in namespace root/cimv2), also removing the filter and handler instances (if not referenced by any other subscription).