概要
このドキュメントでは、Cisco Video Surveillance Manager(VSM)7メディアサーバでカメラデバイスを削除状態に手動で設定する方法について説明します。
著者:Cisco TACエンジニア、Gerald Burgess
背景説明
VSM 7.8より前では、スタック状態になったカメラを手動で削除する方法はありませんでした。その結果、Operations Manager(VSOM)データベースからカメラを取り外すためのスクリプトが作成されました。ただし、カメラのエントリはメディアサーバに残されます。このような場合、メディアサーバのデータベースでカメラデバイスを手動で削除状態に設定する必要があります。
問題
デバイスの固有識別子(UID)を検索し、カメラを削除済み状態に設定する方法。
解決方法
メディアサーバのルートから、次のコマンドを使用して、カメラのデバイスUIDと状態を取得します。
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
カメラのUIDは、ps auxコマンドでも確認できます | grep ums | 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 ~]#