Introduction
This document describes how to manually set a camera device to a deleted state on a Cisco Video Surveillance Manager (VSM) 7 media server.
Contributed by Gerald Burgess, Cisco TAC Engineer.
Background Information
Prior to VSM 7.8, there was no manual way to delete a camera that had gotten into a stuck state. As a result, there was a script written to remove cameras forcably from the Operations Manager (VSOM) database. That however leaves the camera's entry in the media server. In these cases, the camera device would need to be manually set to be in a deleted state in the media server's database.
Problem
How to find the device's Unique Identifier (UID) and then set the camera to a deleted state.
Solution
From root on the media server, use this command to get the device UID and state for the cameras:
echo "select from_base64(d.name) as 'device_name', d.admin_state_value, a.name as 'admin_state_name', d.id as 'camera_id', d.uid as 'camera_uid' from device d, admin_states a where a.enum_value=d.admin_state_value\G;" | /usr/BWhttpd/mysql/bin/mysql --defaults-file=/usr/BWhttpd/mysql/ums/ums.cnf UMS
The UID's of the cameras can also be found with the command ps aux | grep ums | vsmdbg.
Once you have the UID, you can then set it to disabled with:
[root@Dot182 ~]# /usr/BWhttpd/mysql/bin/mysql --defaults-file=/usr/BWhttpd/mysql/ums/ums.cnf UMS
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 65131
Server version: 5.6.18-enterprise-commercial-advanced-log MySQL Enterprise Server - Advanced Edition (Commercial)
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> update device set admin_state_value=3 where uid="e4d410a4-3b7f-4564-acfa-9bdb8eb24b24";
Note: You can also use the camera's ID, which is shorter, in the where statement. The ID appears in the query listing as camera_id.
For example:
[root@Dot181 ~]# echo "select from_base64(d.name) as 'device_name', d.admin_state_value, a.name as 'admin_state_name', d.id as 'camera_id', d.uid as 'camera_uid' from device d, admin_states a where a.enum_value=d.admin_state_value\G;" | /usr/BWhttpd/mysql/bin/mysql --defaults-file=/usr/BWhttpd/mysql/ums/ums.cnf UMS
*************************** 1. row ***************************
device_name: NULL
admin_state_value: 1
admin_state_name: enabled
camera_id: 1
camera_uid: d378fcdc-c484-11e6-9453-005056af6120
*************************** 2. row ***************************
device_name: test
admin_state_value: 1
admin_state_name: enabled
camera_id: 4
camera_uid: 40927fd4-1fe6-478a-90ea-f77db216f61b
[root@Dot181 ~]# echo "update device set admin_state_value=3 where uid='40927fd4-1fe6-478a-90ea-f77db216f61b';" | /usr/BWhttpd/mysql/bin/mysql --defaults-file=/usr/BWhttpd/mysql/ums/ums.cnf UMS
[root@Dot181 ~]# echo "select from_base64(d.name) as 'device_name', d.admin_state_value, a.name as 'admin_state_name', d.id as 'camera_id', d.uid as 'camera_uid' from device d, admin_states a where a.enum_value=d.admin_state_value\G;" | /usr/BWhttpd/mysql/bin/mysql --defaults-file=/usr/BWhttpd/mysql/ums/ums.cnf UMS
*************************** 1. row ***************************
device_name: NULL
admin_state_value: 1
admin_state_name: enabled
camera_id: 1
camera_uid: d378fcdc-c484-11e6-9453-005056af6120
*************************** 2. row ***************************
device_name: test
admin_state_value: 3
admin_state_name: deleted
camera_id: 4
camera_uid: 40927fd4-1fe6-478a-90ea-f77db216f61b
[root@Dot181 ~]# echo "update device set admin_state_value=1 where uid='40927fd4-1fe6-478a-90ea-f77db216f61b';" | /usr/BWhttpd/mysql/bin/mysql --defaults-file=/usr/BWhttpd/mysql/ums/ums.cnf UMS
[root@Dot181 ~]# echo "select from_base64(d.name) as 'device_name', d.admin_state_value, a.name as 'admin_state_name', d.id as 'camera_id', d.uid as 'camera_uid' from device d, admin_states a where a.enum_value=d.admin_state_value\G;" | /usr/BWhttpd/mysql/bin/mysql --defaults-file=/usr/BWhttpd/mysql/ums/ums.cnf UMS
*************************** 1. row ***************************
device_name: NULL
admin_state_value: 1
admin_state_name: enabled
camera_id: 1
camera_uid: d378fcdc-c484-11e6-9453-005056af6120
*************************** 2. row ***************************
device_name: test
admin_state_value: 1
admin_state_name: enabled
camera_id: 4
camera_uid: 40927fd4-1fe6-478a-90ea-f77db216f61b
[root@Dot181 ~]#