{"id":126,"date":"2018-03-28T14:32:26","date_gmt":"2018-03-28T06:32:26","guid":{"rendered":"https:\/\/sumju.net\/?p=126"},"modified":"2018-03-28T14:32:26","modified_gmt":"2018-03-28T06:32:26","slug":"ocs-inventory-%e9%87%8d%e5%a4%8d%e8%ae%a1%e7%ae%97%e6%9c%ba%e8%ae%b0%e5%bd%95","status":"publish","type":"post","link":"https:\/\/sumju.net\/?p=126","title":{"rendered":"OCS Inventory \u91cd\u590d\u8ba1\u7b97\u673a\u8bb0\u5f55"},"content":{"rendered":"<p>\u6700\u8fd1\u5b89\u88c5\u4e86OCS Inventory NG \u548cGLPI \u6765\u76d8\u70b9\u8ba1\u7b97\u673a\u4fe1\u606f\uff0c\u5b8c\u5168\u90e8\u7f72\u540e\u4e00\u76f4\u6709\u4e2a\u5934\u75bc\u7684\u95ee\u9898\u56f0\u6270\u6211\uff0c\u5c31\u662f\u6bcf\u5929\u4f1a\u53d1\u73b0\u81ea\u52a8\u591a\u51fa\u6765\u5f88\u591a\u91cd\u590d\u7684\u8ba1\u7b97\u673a\uff0c\u4e8e\u662f\u5728\u7f51\u4e0a\u627e\u539f\u56e0\uff0c\u4f46\u662f\u5e76\u6ca1\u6709\u53d1\u73b0\u4ec0\u4e48\u6709\u7528\u7684\u4fe1\u606f\u3002<\/p>\n<p>\u7f51\u9875CONFIG \u91cc\u9762\u7684 AUTO_DUPLICATE_LVL \u91cc\u4e5f\u6b63\u786e\u8bbe\u7f6e\u4e86\u5339\u914d\u9879\uff0c\u5c31\u662f\u4e0d\u81ea\u52a8\u5408\u5e76\u3002<\/p>\n<p>\u4e0d\u8fc7\u6700\u540e\u8fd8\u662f\u81ea\u5df1\u641e\u5b9a\u4e86\uff0c\u4e0b\u9762\u8bb0\u5f55\u4e00\u4e0b\u6211\u89e3\u51b3\u95ee\u9898\u7684\u8fc7\u7a0b\u3002<br \/>\n1.z-ocsinventory-server.conf  \u91cc\u9762\u6253\u5f00\u65e5\u5fd7\uff08APACHE\u65e5\u5fd7\uff09\uff0c\u8fd8\u6709OCS\u7f51\u9875\u91cc\u4e5f\u5f00\u542f\u65e5\u5fd7\u529f\u80fd\uff08\u7ba1\u7406\u9875\u9762LOGLEVEL = On\uff09\u3002<br \/>\n PerlSetEnv OCS_OPT_DBI_PRINT_ERROR 1<\/p>\n<p>2. \u67e5\u770b\u65e5\u5fd7\u53d1\u73b0\u6709\u51e0\u5904\u9519\u8bef\u5173\u4e8e\u81ea\u52a8\u5904\u7406duplicate<br \/>\n\/var\/log\/ocsinventory-server\/activity.log<\/p>\n<p>Wed Mar 28 12:04:01 2018;2917;517;PC-2018-03-28-11-58-21;182.168.100.94;OCS-NG_WINDOWS_AGENT_v2.3.1.1;duplicate;replacing_error<\/p>\n<p>3. \u67e5\u770b\u5177\u4f53replacing_erro\u5230\u5e95\u662f\u4ec0\u4e48\u539f\u56e0\u9020\u6210\uff0c\u8fd9\u91cc\u8981\u53bb\u770bapache\u7684\u65e5\u5fd7\u3002<\/p>\n<p>cat \/var\/log\/httpd\/error_log <\/p>\n<p>DBD::mysql::db do failed: Column &#8216;DATE&#8217; cannot be null at \/usr\/local\/share\/perl5\/Apache\/Ocsinventory\/Server\/Duplicate.pm line 270.<\/p>\n<p>\u8fd9\u8bc1\u660e\u662f\u5199\u6570\u636e\u5e93\u7684\u65f6\u5019DATE\u5b57\u6bb5\u4e0d\u80fd\u4e3a\u7a7a<\/p>\n<p>4.\u601d\u8def\u6709\u4e86\uff0c\u7a0b\u5e8f\u6211\u4eec\u5c31\u4e0d\u6539\u4e86\uff0c\u76f4\u63a5\u628a\u6570\u636e\u5e93\u5b57\u6bb5\u51c6\u8bb8\u4e3a\u7a7a\u8bd5\u8bd5\u770b\u3002<br \/>\n\u6253\u5f00Duplicate.pm \u627e\u5230270\u884c\uff0c\u770b\u770b\u5b83\u5230\u5e95\u8981\u5199\u5230\u54ea\u4e2a\u8868\u3002<br \/>\n# Trace duplicate if needed<br \/>\n  if($ENV{&#8216;OCS_OPT_TRACE_DELETED&#8217;}){<br \/>\n    unless(  $dbh->do(&#8216;INSERT INTO deleted_equiv(DATE,DELETED,EQUIVALENT) VALUES(NULL,?,?)&#8217;, {} , $device,$DeviceID)){<br \/>\n      &#038;_unlock($device);<br \/>\n      return(1);<br \/>\n    }<br \/>\n  }<\/p>\n<p>5.\u539f\u6765\u662f\u8981\u7ed9deleted_equiv\u91cc\u6dfb\u52a0\u8bb0\u5f55\u4e0d\u6210\u529f\u3002<\/p>\n<p>\u4e8e\u662f\u4e4e\u628a\u8fd9\u4e2a\u8868\u7684\u6240\u6709\u5b57\u6bb5\u90fd\u51c6\u8bb8\u4e3a\u7a7a\u5e76\u8bbe\u7f6evarchar\u7c7b\u578b\u3002\uff08\u5305\u62ecDate\u5b57\u6bb5\uff09<\/p>\n<p>6\uff0c\u89c2\u5bdf\u4e86\u4e00\u4f1a\u513f\u65e5\u5fd7\uff0c\u53d1\u73b0\u9519\u8bef\u6ca1\u6709\u4e86\uff0c\u6211\u5c45\u7136\u6210\u529f\u4e86\u3002<br \/>\nWed Mar 28 12:59:38 2018;2986;300;PC1-2018-03-28-12-52-43;192.168.100.154;OCS-NG_WINDOWS_AGENT_v2.3.1.1;duplicate;488 => 524<br \/>\nWed Mar 28 14:06:40 2018;2986;300;PC2-2018-03-28-14-02-54;192.168.100.190;OCS-NG_WINDOWS_AGENT_v2.3.1.1;duplicate;521 => 525<\/p>\n<p>\u81ea\u52a8\u5408\u5e76\u4e86\u91cd\u590d\u8bb0\u5f55\uff0c\u8fd9\u6837\u4ee5\u540e\u518d\u4e5f\u4e0d\u7528\u624b\u52a8\u518d\u53bb\u5408\u5e76\u8fd9\u4e9b\u8bb0\u5f55\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u5b89\u88c5\u4e86OCS Inventory NG \u548cGLPI \u6765\u76d8\u70b9\u8ba1\u7b97\u673a\u4fe1\u606f\uff0c\u5b8c\u5168\u90e8\u7f72\u540e\u4e00\u76f4\u6709\u4e2a\u5934\u75bc\u7684\u95ee&hellip; <a href=\"https:\/\/sumju.net\/?p=126\" class=\"more-link read-more\" rel=\"bookmark\">\u7ee7\u7eed\u9605\u8bfb <span class=\"screen-reader-text\">OCS Inventory \u91cd\u590d\u8ba1\u7b97\u673a\u8bb0\u5f55<\/span><i class=\"fa fa-arrow-right\"><\/i><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[14],"tags":[],"class_list":{"0":"post-126","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-linux","7":"h-entry","9":"h-as-article"},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/sumju.net\/index.php?rest_route=\/wp\/v2\/posts\/126","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sumju.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sumju.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sumju.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sumju.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=126"}],"version-history":[{"count":1,"href":"https:\/\/sumju.net\/index.php?rest_route=\/wp\/v2\/posts\/126\/revisions"}],"predecessor-version":[{"id":127,"href":"https:\/\/sumju.net\/index.php?rest_route=\/wp\/v2\/posts\/126\/revisions\/127"}],"wp:attachment":[{"href":"https:\/\/sumju.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=126"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sumju.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=126"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sumju.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=126"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}