簡介
本檔案介紹如何在Cisco Video Surveillance Manager(VSM)7媒體伺服器上手動將攝影機裝置設定為刪除狀態。
作者:思科TAC工程師Gerald Burgess。
背景資訊
在VSM 7.8之前的版本中,沒有手動方式刪除進入停滯狀態的監視器。因此,編寫了一個指令碼,以便從Operations Manager(VSOM)資料庫中強制刪除監視器。但是,這會將相機條目保留在媒體伺服器中。在這些情況下,需要在媒體伺服器的資料庫中將監視器裝置手動設定為處於刪除狀態。
問題
如何查詢裝置的唯一識別符號(UID),然後將監視器設定為已刪除狀態。
解決方案
從媒體伺服器上的root使用者,使用此命令獲取監視器的裝置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
使用命令ps aux也可以找到監視器的UID | grep ums | vsmdbg。
一旦您擁有了UID,就可以使用以下設定將其設定為disabled:
[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 ~]#