# Shell Commands

The Kafka Producer also provides a series of shell commands to help administer and debug the service.

## opennms:kafka-list-alarms

Use the list-alarms command to enumerate the reduction keys and show the associated event labels for the alarms that are present in the topic. This command leverages functionality used by the alarm synchronization process, and as a result this must be enabled for this command to function.

$ssh -p 8101 admin@localhost ... admin@opennms> opennms:kafka-list-alarms uei.opennms.org/alarms/trigger:n33:0.0.0.0:HTTPS_POOLs Alarm: Generic Trigger ## kafka-producer:sync-alarms Use the sync-alarms command to manually trigger the alarm synchronization process.$ ssh -p 8101 admin@localhost
...
Performing synchronization of alarms from the database with those in the ktable.

Number of reduction keys in ktable: 4
Number of reduction keys in the db: 4 (4 alarms total)
Reduction keys added to the ktable: (None)
Reduction keys deleted from the ktable: (None)
Reduction keys updated in the ktable:
uei.opennms.org/nodes/nodeLostService::1:127.0.0.1:Minion-RPC

## opennms:kafka-evaluate-filter

Use the evaluate-filter command to test arbitrary SpEL filtering expressions against alarms or events.

### Evaluating Filters against Alarms

To test a filter against an alarm, specify the alarm’s database ID and the expression to test:

SPEL Expression: getReductionKey().contains('n33')
Alarm with ID 57 has reduction key: uei.opennms.org/alarms/trigger:n33:0.0.0.0:HTTPSPOOLs
Result: true

### Evaluating Filters against Events

To test a filter against an event, specify the event’s UEI and the expression to test: