简介
本文档介绍如何在Cisco Video Surveillance Manager(VSM)7媒体服务器上手动将摄像头设备设置为删除状态。
作者:思科TAC工程师Gerald Burgess。
背景信息
在VSM 7.8之前,没有手动删除进入卡住状态的摄像头的方法。因此,编写了脚本,以便从Operations Manager(VSOM)数据库中强制删除摄像头。但是,这会将摄像头的条目保留在媒体服务器中。在这些情况下,需要手动将摄像头设备设置为媒体服务器数据库中的已删除状态。
问题
如何查找设备的唯一标识符(UID),然后将摄像头设置为删除状态。
解决方案
从媒体服务器的根用户,使用此命令获取摄像头的设备UID和状态:
echo "从设备d中选择from_base64(d.name)作为'device_name',d.admin_state_value,a.name作为'admin_state_name',d.id作为'camera_id',d.uid作为'camera_uid',admin_states,其中a.enum_value=d.admin_state_value\G;" | /usr/BWhttpd/mysql/bin/mysql —defaults-file=/usr/BWhttpd/mysql/ums/ums.cnf UMS。
也可以使用命令ps aux找到摄像头的UID。 |基准 | vsmdbg。
一旦您拥有了UID,您就可以将其设置为禁用状态:
[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";
注意:您还可以在where语句中使用摄像头的ID(较短)。ID在查询列表中显示为camera_id。
例如:
[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 ~]#