Products
This resource is for Nagios Log Server 2024R2/2026. If you are using a older version such as 2024R1 please refer to the legacy guide.
Nagios Log Server is in a red health state. You can see the current cluster state by navigating to Admin -> Cluster Status:
The cluster can be in one of three states: Green: All primary and replica shards are active and assigned to instances. Yellow: All data is available but some replicas are not yet allocated (cluster is fully functional). Red: There is at least one primary shard that is not active and allocated to an instance (cluster is still partially functional). The cluster health is controlled by the worst index status. The index status is controlled by the worst shard status in that index.
The cluster health status is controlled by the least healthy index in the cluster.
What can cause a shard to become unassigned/corrupt?
sudo firewall-cmd --zone=public --permanent --add-port=9300/tcp
sudo firewall-cmd --reload
Now that we know what can cause this issue, let's get your cluster back to a green state. The very first thing you should do is to secure your backups, if you have any. Next, run the following commands from the Linux command line of any instance on the cluster:
First, run the following long command to pull your Opensearch password:
if [ -f /usr/local/nagioslogserver/opensearch/config/opensearch_config.php ]; then nlspass=`grep opensearch_password /usr/local/nagioslogserver/opensearch/config/opensearch_config.php | sed "s/.* = '\(.*\)';/\1/"`; else nlspass=`grep opensearch_password /var/www/html/nagioslogserver/application/config/config.local.php | sed "s/.* = '\(.*\)';/\1/"`; fi
Next, run this command to check cluster health:
curl -u nagioslogserver:$nlspass --cacert /usr/local/nagioslogserver/opensearch/config/root-ca.pem -s -XGET 'https://localhost:9200/_cluster/health?pretty=true'
Cluster health should return a result similar to this:
{
"cluster_name" : "nagios_opensearch",
"status" : "yellow",
"timed_out" : false,
"number_of_nodes" : 1,
"number_of_data_nodes" : 1,
"discovered_master" : true,
"discovered_cluster_manager" : true,
"active_primary_shards" : 91,
"active_shards" : 91,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 78,
"delayed_unassigned_shards" : 0,
"number_of_pending_tasks" : 0,
"number_of_in_flight_fetch" : 0,
"task_max_waiting_in_queue_millis" : 0,
"active_shards_percent_as_number" : 53.84615384615385
}
Note the relocating_shards, initializing shards, and unassigned_shards fields. If a shard is unassigned or initializing, it is not healthy.
From here you can identify which types of shards might be missing. From the above, we can deduce that the 91 assigned shards (active_shards) are primary shards. That must mean that the 78 unassigned_shards are replica shards. This would explain why my health status is yellow.
If you see a high amount of unassigned_shards and initializing_shards, please run the health command once in awhile to see if the number goes down - sometimes Opensearch fixes itself. If the number stays the same for an extended period, you could try rebooting your instances one at a time. If you are still seeing problems, please proceed to Shard Status.
Run the following command to check shard status.
curl -u nagioslogserver:$nlspass --cacert /usr/local/nagioslogserver/opensearch/config/root-ca.pem -s -XGET 'https://localhost:9200/_cat/shards?v'
The command should return a result similar to this:
Note the highlighted fields. Anything INITIALIZING or UNASSIGNED is a red flag. From here, you can see which index the unassigned shards belong to. You can also see whether they are primary (p) or replica (r) shards.
You can get a list of all potential problem shards with the following command:
curl -u nagioslogserver:$nlspass --cacert /usr/local/nagioslogserver/opensearch/config/root-ca.pem -s -XGET 'https://localhost:9200/_cat/shards?v' | egrep 'UNASSIGNED|INITIALIZING'
You can choose one of two procedures: IMPORTANT: If possible, use option 1 - deleting and restoring the indices requires that you have a working backup in place, and that the offending index was backed up prior to the incident. If you decide to use option 2, please proceed at your own risk - we have seen the re-assignment process kill Opensearch, which could cause more problems.
Delete the offending indices, and restore those indices from your backup. A working backup is required for this to be possible. Check your backups by navigating to Admin -> Snapshots & Maintenance. Index deletion command:
curl -u nagioslogserver:$nlspass --cacert /usr/local/nagioslogserver/opensearch/config/root-ca.pem -s -XDELETE 'https://localhost:9200/indexnamehere/'
Example:
curl -u nagioslogserver:$nlspass --cacert /usr/local/nagioslogserver/opensearch/config/root-ca.pem -s -XDELETE 'https://localhost:9200/logstash-2026.11.08'
Attempt to re-assign the shards.
Re-assignment command:
curl -u nagioslogserver:"$nlspass" --cacert /usr/local/nagioslogserver/opensearch/config/root-ca.pem -s -X POST "https://localhost:9200/_cluster/reroute?pretty" -H 'Content-Type: application/json' -d '{"commands":[{"move":{"index":" indexnamehere","shard": shardnumberhere,"from_node":" nodenamehere","to_node":" nodenamehere"}}]}'
Using the screenshot above, here is a full example:
curl -u nagioslogserver:"$nlspass" --cacert /usr/local/nagioslogserver/opensearch/config/root-ca.pem -s -X POST "https://localhost:9200/_cluster/reroute?pretty" -H 'Content-Type: application/json' -d '{"commands":[{"move":{"index":"test-cluster-index","shard":0,"from_node": "54bc3e7e-7478-4f28-bfa7-5020f6fbf0ae","to_node": "54bc3e7e-7478-4f28-bfa7-5020f6fbf0ae"}}]}'
For any support related questions please visit the Nagios Support Forums at: http://support.nagios.com/forum/
© All rights reserved. 2026