---
title: "BSM - Message Queue Count - METRIC CRITICAL - Message Count is ...msgs"
description: "The BSM Message Queue Count service check shows critical status due to message queue buildup. Restarting the opsview-bsm component typically resolves the issue or use an event handler to automate restarts."
url: "https://docs.itrsgroup.com/docs/faq/opsview/4922591941149-opsview-bsm-message-queue-count-metric-critical-message-count-is-msgs/index.html"
---
## Symptoms

- `Opsview - BSM - Message Queue Count` service check is critical with status info `Message Count is ...msgs`

### Cause: Loss of database connection

*Known issue OP-48285*

Losing network connectivity to the database can cause the `bsm-queue` message queue to back up and not clear down—even after the network connection is restored.

### Solution: Restart `opsview-bsm`

Typically, restarting the `opsview-bsm` component should resolve this issue.

1. Log in to your BSM server as `root` (this is usually your orchestrator).

2. Restart the `opsview-bsm` component using `opsview-monit`:

```
/opt/opsview/watchdog/bin/opsview-monit restart opsview-bsm
```

### Solution: Event handler to restart `opsview-bsm`

If you encounter this issue often, it may be best to create an event handler for when this service check goes critical that restarts the `opsview-bsm` component.

Refer to our [event handler documentation](https://docs.itrsgroup.com/docs/opsview/current/monitoring/event-handlers/index.html) for more information about how to do this. Here is an example script you could use to restart the `opsview-bsm` component:

```
#!/bin/bash
## If Service State is CRITICAL (options are OK, WARNING, CRITICAL and UNKNOWN)
## and Service State Type is HARD (options are HARD and SOFT)
## then execute Event Handler action
set -e
if [[ "$NAGIOS_SERVICESTATE" = "CRITICAL" && "$NAGIOS_SERVICESTATETYPE" = "HARD" ]]; then
    echo "restarting opsview-bsm"
    /opt/opsview/coreutils/bin/opsview_watchdog opsview-bsm restart >/dev/null 2>&1
    # record event to syslog
    logger "opsview-bsm restarted by Opsview $NAGIOS_HOSTADDRESS"
fi
```


