廣告

2026 年 4 月
 12345
6789101112
13141516171819
20212223242526
27282930  

彙整

OpenAudIT蒐集電腦資料被其他不同電腦資料覆蓋的問題(兩台資料只剩下一台)

#若還有比對資料會造成設備資料被覆蓋的問題在把比對參數關閉即可
大概找到問題了,比對條件只用TYPE+SERIAL配對,就會造成覆蓋問題。

clip_image002

到設定列表

clip_image003

找到比對出問題的參數

clip_image005

關閉此參數

clip_image007

………………………

查詢設備轉入比對依據

點選LOGO進入GROUP 列表

clip_image008

點選要 View 的裝置列表

clip_image009

點選DISCOVERY LOG

clip_image010

可以看到開頭MATCH的LOG,原來是比對 serial + type 值配對成功,所以以為是同一筆資料覆蓋過去

clip_image012

官方文件
https://community.opmantek.com/display/OA/Matching+Devices


转至元数据结尾

· 由 Mark Unwin创建, 最后修改于十月 17, 2019

转至元数据起始

Match Process

When Open-AudIT receives data about a device, either by discovering the device during an audit run or by the user importing the device, it must determine if this discovered device matches a device that already exists within its database, or if it is a new device that should be added. Open-AudIT uses a series of twelve property matches to determine this. The Match Rules work as OR comparisons, not AND. This means the first rule that matches a field in the discovered device to one in the dB resolves as an existing device. All Matching Rules have to fail in order for a device to be new and result in a new record being created.

Duplicate Devices / Missing Devices

It is important to note that when Open-AudIT determines a match any properties set to ‘y’ must match exactly (and not be blank) in order for Open-AudIT to determine that the discovered device matches a device already in the database. If none of the properties marked ‘Y’ match, then a new device entry will be created, which could result in duplicate device entries. In situations where properties are duplicated, for example a dbus_id is copied during a VM clone, then an existing device may incorrectly get overwritten/updated rather then a new entry being created resulting in missing devices.

Devices will not be matched if their status is set to "deleted". Any other status will allow a match to occur.

Matching Linux Devices

When matching a Linux based device, we prefer to use the Dbus id concatenated with the hostname. We can also use other options as per the above table, but we can retrieve the Dbus ID without root. To retrieve the UUID (from the motherboard), we need to run dmidecode, which does require root. Unfortunately, when you clone an ESXi guest, the Dbus ID does not get recreated – hence our concatenating this with the hostname. There is a good article linked here that details the why’s of hardware IDs. http://0pointer.de/blog/projects/ids.html

Match Order

The logic for device matching is contained in the m_devices.php file, which on a Linux install can be found here: /usr/local/open-audit/code_igniter/application/models/

Matching is conducted in the following order:

1. Match the Opmantek UUID (not configurable).

2. Match the Google Cloud ID (not configurable).

3. match_hostname_uuid

4. match_hostname_dbus

5. match_hostname_serial

6. match_dbus

7. match_dns_fqdn

8. match_dns_hostname

9. match_fqdn

10. match_serial_type

11. match_serial

12. match_sysname_serial

13. match_sysname

14. match_mac (ip table)

15. match_mac (network table)

16. match_mac (addresses)

17. match_ip

18. match_hostname

19. match_ip_no_data

Matching IP Addresses

As at Open-AudIT 3.3.0 we will be implementing a match routine that essentially says "If all I have is an IP, and that IP belongs to a device in the database and that device has not been audited, match that device regardless of the match_ip rule.

The reason for this is in the case of a discovered device that we don’t have credentials for, we have virtually no information except the IP and maybe the DNS Hostname. Neither are considered unique (think DHCP). But in the case where we have a device with that lack of data already preset in the database, assume it is the same device so that we don’t create many false duplicates. This configuration item will be called match_ip_no_data and will be set to YES by default.

Match Properties

These properties are stored in Open-AudIT’s configuration; to access them select Admin -> Configuration -> Discovery from Open-AudIT’s menu. The default values of ‘y’ and ‘n’ simply mean YES and NO. We will use YES and NO in the description, rather than ‘y’ and ‘n’. The stored value should always be either a lowercase y or n.

The properties and their default values are listed below.

Property

Default Value

Description

Property

Default Value

Description

match_dbus

n

Linux based devices only. The DBUS id is supposed to be unique on each Linux device. It is set to NO by default because ESX, upon cloning a guest virtual machine, does not tell the operating system to recreate this identifier. We were receiving reports of discovered devices overwriting one another and this was the culprit.

match_fqdn

y

Should we match a device based on its fqdn.

match_dns_fqdn

n

Should we match a device based on its DNS fqdn.

match_dns_hostname

n

Should we match a device based on its DNS hostname.

match_hostname

y

Should we match a device based on its hostname? Set to YES as hostnames should be unique to a network. This may be a candidate for changing as some users may wish to audit disparate networks (say several different customers networks) that contain hostnames that are identical to others already in Open-AudIT. Say ‘web’ or ‘mail’ or ‘dns’, etc. Certain hostnames are not uncommon to use.

match_hostname_dbus

y

Linux based devices only. Should we use the combination of the hostname (as determined by Open-AudIT) and DBUS id (as reported by an audit script or SSH command) to determine a device match? Set to YES as this is considered a reliable combination.

match_hostname_serial

y

Should we use the combination of the hostname (as determined by Open-AudIT) and serial (as reported by an audit script, SSH command or SNMP query) to determine uniqueness. Set to YES as this is considered a reliable combination.

match_hostname_uuid

y

Should we use the combination of the type (as determined by Open-AudIT) and serial (as reported by an audit script, SSH command or WMI command) to determine uniqueness. Set to YES as this is considered a reliable combination.

match_ip

n

Should we match based only on the device’s IP address? Set to NO because DHCP will cause false positive matches. This may be acceptable to set to YES if you can guarantee no devices will change IP addresses. You may only ever audit a server network for example. In most cases, it is best to leave this to NO.

match_mac

y

Should we match a device based only on it’s discovered MAC addresses. Set to NO prior to 3.3.0. Post 3.3.0 will be set to YES. A MAC address should be unique on a network. See below for an exception to the rule.

match_mac_vmware

n

VMware Workstation tends to use MAC addresses that are not globally unique. IE – Two different workstations may be running VMware Workstation and have two different virtual machines that have the same MAC address. These machines won’t ever need to perform networking outside their hosts using this MAC address, but Open-AudIT will discover the MAC addresses upon an audit. Should we determine uniqueness based on these mac addresses? These MAC addresses typically start with one of the following: 00:0c:29, 00:50:56, 00:05:69, 00:1c:14.

match_serial

y

Should we use the serial (as reported by an audit script, SSH command, WMI command or SNMP query) to determine a device match? Set to YES as this is considered a reliable attribute.

match_serial_type

y

Should we use the combination of the type (as determined by Open-AudIT) and serial (as reported by an audit script, SSH command, WMI command or SNMP query) to determine uniqueness. Set to YES as this is considered a reliable combination.

match_sysname

y

Should we match a device based only on its SNMP sysName.

match_sysname_serial

y

Should we match a device based only on its SNMP sysName and serial.

match_uuid

y

Should we use the UUID (as reported by an audit script, SSH command or WMI command) to determine a device match? Set to YES as this is considered a reliable attribute.

2021新的薪資計算方式(月薪制)

以前月薪/22天(上班日) = 日薪

現在月薪/30天 = 日薪
然後跟你說六日也算錢給你,先別急著歌功頌德…….

不加班的人,可能無感,但如果你加班的話,加班費變相減少,很多人不知道有這層關係。

這其實跟國民智商有關………….終於知道為何帝王術要讓人民變笨點,因為好控制……….

範例算法來比較,情境如下:

假設月薪36000,平日加班4小時。

舊的算法(一般公司都優於勞基法):

36000/22=1637(日薪) 1637/8=205(時薪)

平日加班的話前兩小時1.33,超過兩小時1.66

205*2*1.33=545(加班前兩小時) + 205*2*1.66=681(後兩小時) = 1226

新的算法:

36000/30=1200(日薪) 1200/8=150(時薪)

平日加班的話前兩小時1.33,超過兩小時1.66

150*2*1.33=399(加班前兩小時) + 150*2*1.66=498(後兩小時) = 897

新的加班方式雖然假日加班說你做一個小時也是給八個小時,假設你來公司一小時你也可以拿到1200,但公司是笨蛋讓你來一小時?

怎麼算都是舊的方式加班費比較划算!

百姓收入越來越少,物價卻越來越貴,這是不爭的事實,你也可以繼續覺得沒這麼糟糕,沒有憂患意識的苟且活下去,反正還不至於影響到你讓你不能生存,這苦你還吞得下去。

DELPHI 寫入讀取INI範例

程式範例

uses
     inifiles;

procedure TForm1.btn3Click(Sender: TObject);
var
  inifile: TInifile;
  iniFileName,sAppPath,sMusicDir,sImageDir:string;
begin
  //獲取當前程式的路徑
  //sAppPath:=ExtractFilePath(Application.ExeName);
  iniFileName:=’testset.ini’; //設定ini檔案儲存名稱

  inifile:=TInifile.Create(‘INI\’+iniFileName); //執行目錄下的 INI目錄內建立 testtest.ini

  //寫配置資訊
  inifile.writeString(‘TESTSET’,’123′,’Pictures’); // 大標籤[TESTSET] , 底下的 123=Picture 參數
  inifile.writeString(‘TESTSET’,’456′,’Music’);

  //讀取配置資訊
  sImageDir:=inifile.readString(‘TESTSET’,’123′,”); //讀取[TESTSET]底下 123=” 的”字串值
  sMusicDir:=inifile.readString(‘TESTSET’,’456′,”);

end;

INI檔案範例

[TESTSET]
123=Pictures
456=Music

DELPHI使用lkJSON多層次一般取值與陣列取值範例

文章出處
http://rakelitica.blogspot.com/2012/07/using-lkjson-example-with-google-drive.html

JSON文件範本(可貼到 https://jsoneditoronline.org/#left=local.lapedo&right=local.vaxeha 幫你線上格式化JSON比較好看懂)

{
  "kind": "drive#fileList",
  "etag": "\"ia2FS23424234234ANFYAdsc1Tyua2KKA-HnMs\"",
  "selfLink": "
https://www.googleapis.com/drive/v2/files",
  "items": [
  {
   "kind": "drive#file",
   "id": "0BwtHRVB3TFRHVllvRVE",
   "etag": "\"ia2H5NSXK_wk/MTM0MTc3MTMwMTU5Mg\"",
   "selfLink": "
https://www.googleapis.com/drive/v2/files/0BwPgllvRVE",
   "alternateLink": "
https://docs.google.com/folder/d/0BwPgllvRVE/edit",
   "permissionsLink": "
https://www.googleapis.com/drive/v2/files/0BwPgllvRVE/permissions",
   "title": "Folder0",
   "mimeType": "application/vnd.google-apps.folder",
   "description": "Folzer Zero",
   "labels": {
    "starred": false,
    "hidden": false,
    "trashed": false,
    "restricted": false,
    "viewed": true
   },
   "createdDate": "2012-07-08T18:13:51.185Z",
   "modifiedDate": "2012-07-08T18:15:01.592Z",
   "modifiedByMeDate": "2012-07-08T18:15:01.592Z",
   "lastViewedByMeDate": "2012-07-08T18:15:07.039Z",
   "parents": [
     {
     "kind": "drive#parentReference",
     "id": "0AAPgHUk9PVA",
     "selfLink": "
https://www.googleapis.com/drive/v2/files/0BwPgllvRVE1/parents/0AA6_KcYtHUk9PVA",
     "parentLink": "
https://www.googleapis.com/drive/v2/files/0AA6_KcYtHUk9PVA",
     "isRoot": true
    }
   ],
   "userPermission": {
    "kind": "drive#permission",
    "etag": "\"ia2FSHMEjvcFQvtI4rH3hoJimnEgfM\"",
    "id": "current",
    "role": "owner",
    "type": "user"
   },
   "quotaBytesUsed": "0",
   "ownerNames": [
    "Artur"
   ],
   "lastModifyingUserName": "Artur",
   "editable": true,
   "writersCanShare": true
  },
  {
   "kind": "drive#file",
  }
  {
   "kind": "drive#file",
  }
  ]
}

DELPHI JSON lkJSON 程式範例

procedure TForm1.BlaBlaBla( JSonString : string );
var
  js,
  itjs: TlkJSONobject;

  ii  : integer;
  Str : string;

  Trash : boolean;
begin

  // Parse the String
  js := TlkJSON.ParseText( JSonString ) as TlkJsonObject;

  // Values on the first level are as easy as this
  selfLink := js.getString( ‘selfLink’ );

  // let’s digg into each document …
  for ii:=0 to js.Field[‘items’].Count-1 do
    begin

    // each document is a TlkJSONobject …
    ijs := (js.Field[‘items’].Child[ ii ] as TlkJSONobject);

    // So, it will be so simple to get something like this…
    Item.etag         := ijs.getString( ‘etag’ );
    Item.Id           := ijs.getString( ‘id’ );
    Item.title        := ijs.getString( ‘title’ );
     
    // Or a little bit different…   
    Item.IsTrash      := ijs[‘labels’].Field[‘trashed’].Value;

    end;

  js.Free;
end

D槽磁碟機無法存取,拒絕存取

如果是再網域環境,磁碟機忽然反白無法存取,確定權限也都沒問題,硬碟拿到別台電腦可以讀取,那有可能是設定到GPO鎖USB,試著把這台電腦加入GPO USB開放權限,重新開機試試,感覺是微軟的BUG,把D槽當USB控管了!

1

勞基法加班費分月薪制與時薪制算法

依照勞基法基本工資計算現在應該還是158/1HR
那我覺得月薪制應該比照基本工資
158*30*8 = *37,920* 這是最低的月薪制工資,覺青應該要發請抗爭爭取月薪制!
================
今天請教研究了一下月薪制加班算法
假設你月薪30000,那你的時薪就是:30000/30/8 = 125(比基本工資低,讓我興起另一種月薪制的算法就是開頭的算法)
(國定)假日加班前八小時你只能拿加班費 125*8 = 1000 ,沒錯!比平日加班拿的還少!
所以月薪制沒必要不要假日加班,假日一定要加班請勾補休比較划算(除非你沒時間休)。
================

2020-11-05_124415

人民繼續當肝臟或胰臟-對貪腐無感的器官

#人民繼續當肝臟或胰臟
#G賣兩年當四年拚

國民黨前期腐敗,起碼我還看的到台灣跳躍式成長性的建設發展

國民黨後期腐敗,還是稍微看的到台灣些許建設成長,只是越來越緩慢

民進黨的腐敗,跳躍式的沉淪,成員沒一個有孫運璿的萬分之一骨風,卻受到台灣不少人的愛戴,問題出在哪聰明的人就知道!

這是我活40多年來真真切切親身體驗,並非被媒體風向洗腦。

122532752_3924801677549633_628242323624965795_n

監測ZFTP服務若當機自動重啟

要監控的服務名稱可到服務的內容查詢

clip_image001

於10.20.20.2 FTP SERVER上D槽建立CheckZFtpSrv.bat內容如下:
=========================================
sc query "zFTPsvc" | find "RUNNING" > nul

if "%ERRORLEVEL%" == "0" (

ECHO myService is Already Existed and Runnin!

exit

) else (

::do something you want to do

net start "zFTPsvc"

)

==========================================

將批次檔加入WINDOWS排程執行設定每兩分鐘偵測一次

clip_image002

用電動車看大環境

電動車:
現在補助購買電動車(全民買單給有錢人用,一般人買得起電動車?),20年後處理廢電池(又是全民買單,諸公立委可有想過買車時要先開徵電池處理費?),有沒有覺得這世界都是中產階級賺給有錢人爽?
#請當個有錢人

20201003-更新WINDOWS SERVER 群組原則範本admx-通過Group Policy Editor禁用Microsoft Compatibility Telemetry

今天一次解決兩個問題

WINDOWS SERVER 2012 R2 GPO管理範本只到WIN 8,今天要新增WIN 10 1909範本然後用GPO方式關閉CLIENT PC的Microsoft Compatibility Telemetry(會造成硬碟讀寫與CPU過高)

這邊更新WIN 10 1909 範本

下載WIN 10 1909範本

https://www.microsoft.com/en-us/download/100591

2.安裝後,Windows 10 Version 1511 ADMX檔預設存放路徑如下
C:\Program Files (x86)\Microsoft Group Policy\Windows 10 Version 1511\

C:\Program Files (x86)\Microsoft Group Policy\Windows 10 November 2019 Update (1909)\PolicyDefinitions\
3.複製PolicyDefinitions整個目錄,貼上至「 C:\Windows\SYSVOL\sysvol\%userdnsdomain%\Policies 」資料夾內
4.開啟群組原則管理,至原則\系統管理範本內就會出現新放入的原則

clip_image002

===========================

方法 2. 通過Group Policy Editor禁用Microsoft Compatibility Telemetry

步驟 1. 同時按住「Windows+R」並輸入:gpedit.msc,點擊「確定」。

clip_image003

步驟 2. 進入「電腦設定」>「系統管理範本」>「Windows元件」>「資料收集與預覽版」。

clip_image004

步驟 3. 雙擊「允許遙測」。
通過Group Policy Editor禁用Microsoft Compatibility Telemetry – 3

步驟 4. 單擊「已停用」,然後點擊「確定」。

clip_image005