Import Debian changes 2.2.3-1
fusioninventory-agent (2.2.3-1) unstable; urgency=low
* New upstream release
fusioninventory-agent (2.2.2-1) unstable; urgency=low
* New upstream release
Gonéri Le Bouder authored 11 years ago
Guillaume Bougard committed 5 years ago
0 | 0 | Revision history for FusionInventory agent |
1 | 1 | |
2 | 2.2.1 | |
2 | 2.2.3 Mon, 25 Jun 2012 21:36:29 +0200 | |
3 | General: | |
4 | * Fix battery voltage and capacity retrieval | |
5 | * Add --timeout option | |
6 | ||
7 | MacOSX: | |
8 | * Fix global memory and CPU inventory | |
9 | * Fix drives inventory | |
10 | ||
11 | Linux: | |
12 | * LXC support (Egor Morozov) | |
13 | ||
14 | 2.2.2 Wed, 30 May 2012 16:56:43 +0200 | |
15 | General: | |
16 | * Improve README | |
17 | * Fix Screen.pm syntax error | |
18 | * Add a test_requires dependency on LWP::Protocol::https | |
19 | ||
20 | Windows: | |
21 | * fix command execution | |
22 | ||
23 | 7ff3260 fix warning if getDevicesFromUdev returns nothing | |
24 | ||
25 | Linux: | |
26 | * detect Virtuozzo VM (Alexander Evseev) | |
27 | ||
28 | 2.2.1 Thu, 24 May 2012 14:39:50 +0200 | |
3 | 29 | General: |
4 | 30 | * failure encoding with UTF8 content when using Fusion protocol (#1663) |
5 | 31 | * wrong CSS path (#1580) |
7 | 7 | contrib/yum-plugin/INSTALL |
8 | 8 | etc/agent.cfg |
9 | 9 | fusioninventory-agent |
10 | fusioninventory-agent.1.html | |
10 | 11 | fusioninventory-injector |
11 | 12 | fusioninventory-win32-service |
12 | 13 | inc/Module/AutoInstall.pm |
160 | 161 | lib/FusionInventory/Agent/Task/Inventory/Input/Virtualization.pm |
161 | 162 | lib/FusionInventory/Agent/Task/Inventory/Input/Virtualization/Hpvm.pm |
162 | 163 | lib/FusionInventory/Agent/Task/Inventory/Input/Virtualization/Libvirt.pm |
164 | lib/FusionInventory/Agent/Task/Inventory/Input/Virtualization/Lxc.pm | |
163 | 165 | lib/FusionInventory/Agent/Task/Inventory/Input/Virtualization/Parallels.pm |
164 | 166 | lib/FusionInventory/Agent/Task/Inventory/Input/Virtualization/Qemu.pm |
165 | 167 | lib/FusionInventory/Agent/Task/Inventory/Input/Virtualization/SolarisZones.pm |
621 | 623 | resources/solaris/showrev/x86-3 |
622 | 624 | resources/solaris/smbios/x86-1 |
623 | 625 | resources/solaris/smbios/x86-3 |
626 | resources/virtualization/lxc/config | |
627 | resources/virtualization/lxc/lxc-info_-n_name1 | |
628 | resources/virtualization/lxc/lxc-ls_-1 | |
624 | 629 | resources/virtualization/prlctl/sample1 |
625 | 630 | resources/virtualization/README |
626 | 631 | resources/virtualization/vboxmanage/sample1 |
759 | 764 | t/inventory/solaris/networks.t |
760 | 765 | t/inventory/solaris/storages.t |
761 | 766 | t/inventory/virtualization/libvirt.t |
767 | t/inventory/virtualization/lxc.t | |
762 | 768 | t/inventory/virtualization/parallels.t |
763 | 769 | t/inventory/virtualization/virtualbox.t |
764 | 770 | t/inventory/virtualization/xen.t |
7 | 7 | IO::Capture::Stderr: 0 |
8 | 8 | IO::Socket::SSL: 0 |
9 | 9 | IPC::Run: 0 |
10 | LWP::Protocol::https: 0 | |
10 | 11 | Test::Exception: 0 |
11 | 12 | Test::MockModule: 0 |
12 | 13 | Test::More: 0.93 |
30 | 31 | Compress::Zlib: 0 |
31 | 32 | HTTP::Daemon: 0 |
32 | 33 | IO::Socket::SSL: 0 |
34 | LWP::Protocol::https: 0 | |
33 | 35 | Net::CUPS: 0.6 |
34 | 36 | Proc::Daemon: 0 |
35 | 37 | Proc::PID::File: 0 |
44 | 46 | perl: 5.8.0 |
45 | 47 | resources: |
46 | 48 | license: http://opensource.org/licenses/gpl-license.php |
47 | version: 2.2.1 | |
49 | version: 2.2.3 |
28 | 28 | "IO::Capture::Stderr" : "0", |
29 | 29 | "IO::Socket::SSL" : "0", |
30 | 30 | "IPC::Run" : "0", |
31 | "LWP::Protocol::https" : "0", | |
31 | 32 | "Test::Exception" : "0", |
32 | 33 | "Test::MockModule" : "0", |
33 | 34 | "Test::More" : "0.93", |
53 | 54 | } |
54 | 55 | }, |
55 | 56 | "release_status" : "stable", |
56 | "version" : "v2.2.1" | |
57 | "version" : "v2.2.3" | |
57 | 58 | } |
9 | 9 | IO::Capture::Stderr: 0 |
10 | 10 | IO::Socket::SSL: 0 |
11 | 11 | IPC::Run: 0 |
12 | LWP::Protocol::https: 0 | |
12 | 13 | Test::Exception: 0 |
13 | 14 | Test::MockModule: 0 |
14 | 15 | Test::More: 0.93 |
35 | 36 | UNIVERSAL::require: 0 |
36 | 37 | XML::TreePP: 0.26 |
37 | 38 | perl: 5.008 |
38 | version: v2.2.1 | |
39 | version: v2.2.3 |
26 | 26 | recommends 'HTTP::Daemon' => undef; |
27 | 27 | recommends 'Net::CUPS' => 0.60; |
28 | 28 | recommends 'IO::Socket::SSL' => undef; |
29 | recommends 'LWP::Protocol::https' => undef; | |
29 | 30 | |
30 | 31 | if ($OSNAME ne 'MSWin32') { |
31 | 32 | recommends 'Proc::Daemon' => undef; |
46 | 47 | test_requires 'Test::MockModule' => undef; |
47 | 48 | test_requires 'Test::More' => '0.93'; # subtest |
48 | 49 | test_requires 'YAML' => undef; |
50 | test_requires 'LWP::Protocol::https' => undef; | |
49 | 51 | |
50 | 52 | install_script 'fusioninventory-agent'; |
51 | 53 | install_script 'fusioninventory-win32-service' if $OSNAME eq 'MSWin32'; |
2 | 2 | |
3 | 3 | Description |
4 | 4 | ----------- |
5 | The fusioinventory agent is a generic agent, running on each managed node. It | |
6 | can perform a certain number of actions, called tasks, according to its own | |
7 | execution plan, or on behalf of a GLPI server with fusioninventory plugin, | |
8 | acting as a control point. | |
5 | The FusionInventory agent is a generic management agent. It can perform a | |
6 | certain number of tasks, according to its own execution plan, or on behalf of a | |
7 | GLPI server with fusioninventory plugin, acting as a control point. | |
9 | 8 | |
10 | 9 | Two of these tasks are included in agent source distribution, local inventory |
11 | 10 | and wake on lan. Other tasks are distributed separatly, excepted for binary |
0 | fusioninventory-agent (2.2.3-1) unstable; urgency=low | |
1 | ||
2 | * New upstream release | |
3 | ||
4 | -- Gonéri Le Bouder <goneri@rulezlan.org> Tue, 26 Jun 2012 16:45:48 +0200 | |
5 | ||
6 | fusioninventory-agent (2.2.2-1) unstable; urgency=low | |
7 | ||
8 | * New upstream release | |
9 | ||
10 | -- Gonéri Le Bouder <goneri@rulezlan.org> Wed, 30 May 2012 18:01:10 +0200 | |
11 | ||
0 | 12 | fusioninventory-agent (2.2.1-1) unstable; urgency=low |
1 | 13 | |
2 | 14 | * New upstream release |
76 | 76 | ca-cert-file = |
77 | 77 | # do not check server SSL certificates |
78 | 78 | no-ssl-check = 0 |
79 | # connection timeout | |
80 | timeout = 180 | |
79 | 81 | |
80 | 82 | # |
81 | 83 | # Web interface options |
50 | 50 | 'server|s=s', |
51 | 51 | 'stdout', |
52 | 52 | 'tag|t=s', |
53 | 'timeout=i', | |
53 | 54 | 'user|u=s', |
54 | 55 | 'version', |
55 | 56 | 'wait|w=s', |
158 | 159 | --ca-cert-dir=D path to the CA certificates directory |
159 | 160 | --ca-cert-file=F path to the CA certificates file |
160 | 161 | --no-ssl-check do not check server SSL certificates (false) |
162 | --timeout connection timeout (180) | |
161 | 163 | |
162 | 164 | Web interface options |
163 | 165 | --no-httpd disable embedded web server (false) |
452 | 454 | |
453 | 455 | Trust requests from given range without authentication token (false). |
454 | 456 | |
457 | For example: "192.168.0.0/24", "192.68.168.0.5" or an IP range like | |
458 | "20.34.101.207 - 201.3.9.99". See L<Net::IP> documentation to get more example. | |
459 | ||
455 | 460 | =back |
456 | 461 | |
457 | 462 | =head2 Logging options |
0 | <?xml version="1.0" ?> | |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
2 | <html xmlns="http://www.w3.org/1999/xhtml"> | |
3 | <head> | |
4 | <title>fusioninventory-agent - FusionInventory agent For Linux/UNIX, Windows and MacOSX</title> | |
5 | <meta http-equiv="content-type" content="text/html; charset=utf-8" /> | |
6 | <link rev="made" href="mailto:root@localhost" /> | |
7 | </head> | |
8 | ||
9 | <body style="background-color: white"> | |
10 | ||
11 | ||
12 | <!-- INDEX BEGIN --> | |
13 | <div name="index"> | |
14 | <p><a name="__index__"></a></p> | |
15 | ||
16 | <ul> | |
17 | ||
18 | <li><a href="#name">NAME</a></li> | |
19 | <li><a href="#synopsis">SYNOPSIS</a></li> | |
20 | <li><a href="#examples">EXAMPLES</a></li> | |
21 | <li><a href="#description">DESCRIPTION</a></li> | |
22 | <li><a href="#ocs_inventory_protocol">OCS INVENTORY PROTOCOL</a></li> | |
23 | <ul> | |
24 | ||
25 | <li><a href="#first__the_prolog">First, The PROLOG</a></li> | |
26 | <li><a href="#module_execution">Module execution</a></li> | |
27 | <li><a href="#server_mode__windows_service_or_unix_daemon_">Server mode (Windows service or Unix daemon)</a></li> | |
28 | </ul> | |
29 | ||
30 | <li><a href="#options">OPTIONS</a></li> | |
31 | <ul> | |
32 | ||
33 | <li><a href="#target_definition_options">Target definition options</a></li> | |
34 | <li><a href="#target_scheduling_options">Target scheduling options</a></li> | |
35 | <li><a href="#task_selection_options">Task selection options</a></li> | |
36 | <li><a href="#inventory_task_specific_options">Inventory task specific options</a></li> | |
37 | <li><a href="#package_deployment_task_specific_options">Package deployment task specific options</a></li> | |
38 | <li><a href="#server_target_specific_options">Server target specific options</a></li> | |
39 | <li><a href="#web_interface_options">Web interface options</a></li> | |
40 | <li><a href="#logging_options">Logging options</a></li> | |
41 | <li><a href="#configuration_options">Configuration options</a></li> | |
42 | <li><a href="#execution_mode_options">Execution mode options</a></li> | |
43 | </ul> | |
44 | ||
45 | <li><a href="#configuration">CONFIGURATION</a></li> | |
46 | </ul> | |
47 | ||
48 | <hr name="index" /> | |
49 | </div> | |
50 | <!-- INDEX END --> | |
51 | ||
52 | <p> | |
53 | </p> | |
54 | <h1><a name="name">NAME</a></h1> | |
55 | <p>fusioninventory-agent - FusionInventory agent For Linux/UNIX, Windows and MacOSX</p> | |
56 | <p> | |
57 | </p> | |
58 | <hr /> | |
59 | <h1><a name="synopsis">SYNOPSIS</a></h1> | |
60 | <p><strong>fusioninventory-agent</strong> [options] [--server server|--local directory|--sdout]</p> | |
61 | <pre> | |
62 | Target definition options | |
63 | -s --server=URI send tasks result to a server | |
64 | -l --local=DIR write tasks results in a directory | |
65 | --stdout write tasks result on STDOUT</pre> | |
66 | <pre> | |
67 | Target scheduling options | |
68 | --delaytime=DURATION maximum initial delay before first target, in seconds (3600) | |
69 | -w --wait=DURATION maximum delay between each target, in seconds | |
70 | --lazy do not contact the target before next scheduled time</pre> | |
71 | <pre> | |
72 | Task selection options | |
73 | --list-tasks list available tasks and exit | |
74 | --no-task=TASK do not run given task</pre> | |
75 | <pre> | |
76 | Inventory task specific options | |
77 | --no-category=CATEGORY do not list given category items | |
78 | --scan-homedirs allow to scan use home directories (false) | |
79 | --html save the inventory as HTML (false) | |
80 | -f --force always send data to server (false) | |
81 | -t --tag=TAG mark the machine with given tag | |
82 | --backend-collect-timeout timeout for inventory modules execution (30) | |
83 | --additional-content=FILE additional inventory content</pre> | |
84 | <pre> | |
85 | Package deployment task specific options | |
86 | --no-p2p do not use peer to peer to download files (false)</pre> | |
87 | <pre> | |
88 | Network options: | |
89 | -P --proxy=PROXY proxy address | |
90 | -u --user=USER user name for server authentication | |
91 | -p --password=PWD password for server authentication | |
92 | --ca-cert-dir=D path to the CA certificates directory | |
93 | --ca-cert-file=F path to the CA certificates file | |
94 | --no-ssl-check do not check server SSL certificates (false) | |
95 | --timeout connection timeout (180)</pre> | |
96 | <pre> | |
97 | Web interface options | |
98 | --no-httpd disable embedded web server (false) | |
99 | --httpd-ip=IP network interface to listen to | |
100 | --httpd-port=PORT network port to listen to (62354) | |
101 | --httpd-trust=RANGE trust requests from range without authentication token (false)</pre> | |
102 | <pre> | |
103 | Logging options | |
104 | --logger=BACKEND logger backend [Stderr|File|Syslog] (Stderr) | |
105 | --logfile=FILE log file | |
106 | --logfile-maxsize=X maximum size of the log file in MB (0) | |
107 | --logfacility=FACILITY syslog facility (LOG_USER) | |
108 | --color use color in the console (false)</pre> | |
109 | <pre> | |
110 | Configuration options | |
111 | --config=BACKEND configuration backend [file|registry|none] | |
112 | --conf-file=FILE configuration file</pre> | |
113 | <pre> | |
114 | Execution mode options | |
115 | -d --daemon run the agent as a daemon (false) | |
116 | --no-fork don't fork in background (false) | |
117 | --debug debug mode (false) | |
118 | --version print the version and exit</pre> | |
119 | <p> | |
120 | </p> | |
121 | <hr /> | |
122 | <h1><a name="examples">EXAMPLES</a></h1> | |
123 | <pre> | |
124 | % fusioninventory-agent --server localhost | |
125 | # execute all available tasks required by a local server</pre> | |
126 | <pre> | |
127 | % fusioninventory-agent --server <a href="http://localhost/ocsinventory2">http://localhost/ocsinventory2</a> | |
128 | # execute all available tasks required by a local server, using a specific | |
129 | # URI</pre> | |
130 | <pre> | |
131 | % fusioninventory-agent --server https://localhost/ocsinventory | |
132 | # execute all available tasks required by a local server, using a secure | |
133 | # connection</pre> | |
134 | <pre> | |
135 | % fusioninventory-agent --server localhost --user test --password s3cr3t | |
136 | # execute all available tasks required by a local server, using HTTP | |
137 | # authentication</pre> | |
138 | <pre> | |
139 | % fusioninventory-agent --local /tmp | |
140 | # execute all available tasks and write the result in /tmp directory</pre> | |
141 | <pre> | |
142 | % fusioninventory-agent --local /tmp --html | |
143 | # execute all available tasks and write the result in /tmp directory in | |
144 | # HTML format</pre> | |
145 | <p> | |
146 | </p> | |
147 | <hr /> | |
148 | <h1><a name="description">DESCRIPTION</a></h1> | |
149 | <p><em class="file">fusioninventory-agent</em> is an agent for OCS Inventory server and | |
150 | FusionInventory for GLPI servers. It creates local inventory of the machines | |
151 | (hardware and software) and send it to the server. It can also write it | |
152 | in a local XML file. | |
153 | This agent is the successor of the former linux_agent which was released with | |
154 | OCS 1.01 and prior. It also replaces the Solaris/AIX/BSD unofficial agents.</p> | |
155 | <p>Supported systems:</p> | |
156 | <dl> | |
157 | <dt><strong><a name="windows" class="item"><em class="file">Windows</em> (since Windows 2000)</a></strong></dt> | |
158 | ||
159 | <dt><strong><a name="gnu_linux" class="item"><em class="file">GNU/Linux</em></a></strong></dt> | |
160 | ||
161 | <dt><strong><a name="macosx" class="item"><em class="file">MacOSX</em></a></strong></dt> | |
162 | ||
163 | <dt><strong><a name="solaris" class="item"><em class="file">Solaris</em></a></strong></dt> | |
164 | ||
165 | <dt><strong><a name="freebsd" class="item"><em class="file">FreeBSD</em></a></strong></dt> | |
166 | ||
167 | <dt><strong><a name="netbsd" class="item"><em class="file">NetBSD</em></a></strong></dt> | |
168 | ||
169 | <dt><strong><a name="openbsd" class="item"><em class="file">OpenBSD</em></a></strong></dt> | |
170 | ||
171 | <dt><strong><a name="aix" class="item"><em class="file">AIX</em></a></strong></dt> | |
172 | ||
173 | <dt><strong><a name="hp_ux" class="item"><em class="file">HP-UX</em></a></strong></dt> | |
174 | ||
175 | <dt><strong><a name="gnu_kfreebsd" class="item"><em class="file">GNU/kFreeBSD</em></a></strong></dt> | |
176 | ||
177 | </dl> | |
178 | <p> | |
179 | </p> | |
180 | <hr /> | |
181 | <h1><a name="ocs_inventory_protocol">OCS INVENTORY PROTOCOL</a></h1> | |
182 | <p>FusionInventory Agent uses OCS Inventory protocol and is compatible with OCS | |
183 | Inventory server. The agent uses the same protocol with the FusionInventory | |
184 | For GLPI plugin.</p> | |
185 | <p>The OCS protocol is basicly an exchange of XML file done over HTTP(S).</p> | |
186 | <p> | |
187 | </p> | |
188 | <h2><a name="first__the_prolog">First, The PROLOG</a></h2> | |
189 | <p>The agent send a first message to give it's ID (DEVICEID). The | |
190 | server send back to the agent an XML file with a list of parameter. It's the | |
191 | PROLOG RESP. You can see it if you're in Debug mode. | |
192 | In this PROLOG, the server send the PROLOG_FREQ. The agent will use it to | |
193 | know when it need to contact the server for the next time.</p> | |
194 | <p>The agent compute the next query date this way:</p> | |
195 | <pre> | |
196 | PROLOG_FREQ/2+RANDOM(PROLOG_FREQ/2)</pre> | |
197 | <p> | |
198 | </p> | |
199 | <h2><a name="module_execution">Module execution</a></h2> | |
200 | <p>The agent will launch each modules and pass the list of options found in the | |
201 | PROLOG RESP as parameter. The module can send information directly to the | |
202 | server (inventory, SNMP scan result, etc)</p> | |
203 | <p> | |
204 | </p> | |
205 | <h2><a name="server_mode__windows_service_or_unix_daemon_">Server mode (Windows service or Unix daemon)</a></h2> | |
206 | <p>In server mode, the agent wait during a period between the last PROLOG and | |
207 | PROLOG_FREQ. If PROLOG_FREQ is not set, it will use --delaytime value. | |
208 | The default value is 3600.</p> | |
209 | <p> | |
210 | </p> | |
211 | <hr /> | |
212 | <h1><a name="options">OPTIONS</a></h1> | |
213 | <p>Most of the options are available in a <em>short</em> form and a <em>long</em> form. For | |
214 | example, the two lines below are all equivalent:</p> | |
215 | <pre> | |
216 | % fusioninventory-agent -s localhost | |
217 | % fusioninventory-agent --server localhost</pre> | |
218 | <p> | |
219 | </p> | |
220 | <h2><a name="target_definition_options">Target definition options</a></h2> | |
221 | <dl> | |
222 | <dt><strong><a name="s_server_uri" class="item"><strong>-s</strong>, <strong>--server</strong>=<em>URI</em></a></strong></dt> | |
223 | ||
224 | <dd> | |
225 | <p>Send results of tasks execution to given server.</p> | |
226 | <p>If <em>URI</em> doesn't start with http:// or https://, the agent assume the | |
227 | parameter is a hostname and rewrite it as:</p> | |
228 | <pre> | |
229 | % --server=<a href="http://servername/ocsinventory">http://servername/ocsinventory</a></pre> | |
230 | <p>In general, OCS Inventory server URL have this format:</p> | |
231 | <pre> | |
232 | <a href="http://servername/ocsinventory">http://servername/ocsinventory</a></pre> | |
233 | <p>and FusionInventory for GLPI this one:</p> | |
234 | <pre> | |
235 | <a href="http://servername/glpi/plugins/fusioninventory/front/plugin_fusioninventory.communication.php">http://servername/glpi/plugins/fusioninventory/front/plugin_fusioninventory.communication.php</a></pre> | |
236 | <p>Multiple values can be specified, using comma as a separator.</p> | |
237 | </dd> | |
238 | <dt><strong><a name="l_local_dir" class="item"><strong>-l</strong>, <strong>--local</strong>=<em>DIR</em></a></strong></dt> | |
239 | ||
240 | <dd> | |
241 | <p>Write the results of tasks execution to given directory.</p> | |
242 | </dd> | |
243 | <dt><strong><a name="stdout" class="item"><strong>--stdout</strong></a></strong></dt> | |
244 | ||
245 | <dd> | |
246 | <p>Write the results of tasks execution on stdout.</p> | |
247 | </dd> | |
248 | </dl> | |
249 | <p> | |
250 | </p> | |
251 | <h2><a name="target_scheduling_options">Target scheduling options</a></h2> | |
252 | <dl> | |
253 | <dt><strong><a name="delaytime_limit" class="item"><strong>--delaytime</strong>=<em>LIMIT</em></a></strong></dt> | |
254 | ||
255 | <dd> | |
256 | <p>Set an initial delay before the first target, whose value is computed randomly | |
257 | between LIMIT / 2 and LIMIT seconds. This setting is ignored for server targets | |
258 | after the initial contact, in favor of server-specified parameter | |
259 | (PROLOG_FREQ).</p> | |
260 | </dd> | |
261 | <dt><strong><a name="w_limit_wait_limit" class="item"><strong>-w</strong> <em>LIMIT</em>, <strong>--wait</strong>=<em>LIMIT</em></a></strong></dt> | |
262 | ||
263 | <dd> | |
264 | <p>Set a delay between each targets, whose value is computed randomly between 0 | |
265 | and LIMIT seconds.</p> | |
266 | </dd> | |
267 | <dt><strong><a name="lazy" class="item"><strong>--lazy</strong></a></strong></dt> | |
268 | ||
269 | <dd> | |
270 | <p>Do not contact the target before next scheduled time.</p> | |
271 | <p>This option is only available when the agent is not run as a server.</p> | |
272 | </dd> | |
273 | </dl> | |
274 | <p> | |
275 | </p> | |
276 | <h2><a name="task_selection_options">Task selection options</a></h2> | |
277 | <dl> | |
278 | <dt><strong><a name="no_task_task" class="item"><strong>--no-task</strong>=<em>TASK</em></a></strong></dt> | |
279 | ||
280 | <dd> | |
281 | <p>Disable the given task</p> | |
282 | </dd> | |
283 | <dt><strong><a name="list_tasks" class="item"><strong>--list-tasks</strong></a></strong></dt> | |
284 | ||
285 | <dd> | |
286 | <p>List available tasks and exit</p> | |
287 | </dd> | |
288 | </dl> | |
289 | <p> | |
290 | </p> | |
291 | <h2><a name="inventory_task_specific_options">Inventory task specific options</a></h2> | |
292 | <dl> | |
293 | <dt><strong><a name="no_category_category" class="item"><strong>--no-category</strong>=<em>CATEGORY</em></a></strong></dt> | |
294 | ||
295 | <dd> | |
296 | <p>Do not list given category items in inventory.</p> | |
297 | </dd> | |
298 | <dt><strong><a name="scan_homedirs" class="item"><strong>--scan-homedirs</strong></a></strong></dt> | |
299 | ||
300 | <dd> | |
301 | <p>Allow the agent to scan home directories for virtual machines.</p> | |
302 | </dd> | |
303 | <dt><strong><a name="html" class="item"><strong>--html</strong></a></strong></dt> | |
304 | ||
305 | <dd> | |
306 | <p>Save the inventory as HTML.</p> | |
307 | <p>This is only used for local inventories.</p> | |
308 | </dd> | |
309 | <dt><strong><a name="f_force" class="item"><strong>-f</strong>, <strong>--force</strong></a></strong></dt> | |
310 | ||
311 | <dd> | |
312 | <p>Send an inventory to the server, even if this last one doesn't ask for it.</p> | |
313 | </dd> | |
314 | <dt><strong><a name="tag_tag" class="item"><strong>--tag</strong>=<em>TAG</em></a></strong></dt> | |
315 | ||
316 | <dd> | |
317 | <p>Mark the machine with given tag.</p> | |
318 | </dd> | |
319 | <dt><strong><a name="backend_collect_timeout_time" class="item"><strong>--backend-collect-timeout</strong>=<em>TIME</em></a></strong></dt> | |
320 | ||
321 | <dd> | |
322 | <p>Timeout for inventory modules execution.</p> | |
323 | </dd> | |
324 | </dl> | |
325 | <p> | |
326 | </p> | |
327 | <h2><a name="package_deployment_task_specific_options">Package deployment task specific options</a></h2> | |
328 | <dl> | |
329 | <dt><strong><a name="no_p2p" class="item"><strong>--no-p2p</strong></a></strong></dt> | |
330 | ||
331 | <dd> | |
332 | <p>Do not use peer to peer to download files.</p> | |
333 | </dd> | |
334 | </dl> | |
335 | <p> | |
336 | </p> | |
337 | <h2><a name="server_target_specific_options">Server target specific options</a></h2> | |
338 | <dl> | |
339 | <dt><strong><a name="p_proxy_proxy" class="item"><strong>-P</strong>, <strong>--proxy</strong>=<em>PROXY</em></a></strong></dt> | |
340 | ||
341 | <dd> | |
342 | <p>Use <em>PROXY</em> as HTTP proxy.</p> | |
343 | <p>By default, the agent uses HTTP_PROXY environment variable.</p> | |
344 | </dd> | |
345 | <dt><strong><a name="u_user_user_user" class="item"><strong>-u</strong> <em>USER</em>, <strong>--user</strong>=<em>USER</em></a></strong></dt> | |
346 | ||
347 | <dd> | |
348 | <p>Use <em>USER</em> for server authentication.</p> | |
349 | </dd> | |
350 | <dt><strong><a name="p_password_password" class="item"><strong>-p</strong>, <strong>--password</strong>=<em>PASSWORD</em></a></strong></dt> | |
351 | ||
352 | <dd> | |
353 | <p>Use <em>PASSWORD</em> for server authentication.</p> | |
354 | </dd> | |
355 | <dt><strong><a name="ca_cert_dir_path" class="item"><strong>--ca-cert-dir</strong>=<em>PATH</em></a></strong></dt> | |
356 | ||
357 | <dd> | |
358 | <p>Path to the CA certificates directory.</p> | |
359 | </dd> | |
360 | <dt><strong><a name="ca_cert_file_file" class="item"><strong>--ca-cert-file</strong>=<em>FILE</em></a></strong></dt> | |
361 | ||
362 | <dd> | |
363 | <p>Path to the CA certificates file.</p> | |
364 | </dd> | |
365 | <dt><strong><a name="no_ssl_check" class="item"><strong>--no-ssl-check</strong></a></strong></dt> | |
366 | ||
367 | <dd> | |
368 | <p>Do not check server SSL certificates.</p> | |
369 | <p>Hint: you can set HTTPS_DEBUG environment variable to get SSL error messages in | |
370 | the console.</p> | |
371 | </dd> | |
372 | </dl> | |
373 | <p> | |
374 | </p> | |
375 | <h2><a name="web_interface_options">Web interface options</a></h2> | |
376 | <dl> | |
377 | <dt><strong><a name="no_httpd" class="item"><strong>--no-httpd</strong></a></strong></dt> | |
378 | ||
379 | <dd> | |
380 | <p>Disable the embedded web server.</p> | |
381 | </dd> | |
382 | <dt><strong><a name="httpd_ip_ip" class="item"><strong>--httpd-ip</strong>=<em>IP</em></a></strong></dt> | |
383 | ||
384 | <dd> | |
385 | <p>The network interface to use for the embedded web server (all | |
386 | available interfaces).</p> | |
387 | </dd> | |
388 | <dt><strong><a name="httpd_port_port" class="item"><strong>--httpd-port</strong>=<em>PORT</em></a></strong></dt> | |
389 | ||
390 | <dd> | |
391 | <p>The network port to use for the embedded web server (62354).</p> | |
392 | </dd> | |
393 | <dt><strong><a name="httpd_trust_range" class="item"><strong>--httpd-trust</strong>=<em>RANGE</em></a></strong></dt> | |
394 | ||
395 | <dd> | |
396 | <p>Trust requests from given range without authentication token (false).</p> | |
397 | <p>For example: "192.168.0.0/24", "192.68.168.0.5" or an IP range like | |
398 | "20.34.101.207 - 201.3.9.99". See <a href="/Net/IP.html">the Net::IP manpage</a> documentation to get more example.</p> | |
399 | </dd> | |
400 | </dl> | |
401 | <p> | |
402 | </p> | |
403 | <h2><a name="logging_options">Logging options</a></h2> | |
404 | <dl> | |
405 | <dt><strong><a name="logger_backend" class="item"><strong>--logger</strong>=<em>BACKEND</em></a></strong></dt> | |
406 | ||
407 | <dd> | |
408 | <p>Logger backend to use. It can be:</p> | |
409 | <dl> | |
410 | <dt> | |
411 | <dd> | |
412 | <p>Stderr: log messages directly in the console.</p> | |
413 | </dd> | |
414 | <dt> | |
415 | <dd> | |
416 | <p>File: log messages in a file.</p> | |
417 | </dd> | |
418 | <dt> | |
419 | <dd> | |
420 | <p>Syslog: log messages through the local syslog server</p> | |
421 | </dd> | |
422 | </dl> | |
423 | <p>Multiple values can be specified, using comma as a separator.</p> | |
424 | </dd> | |
425 | <dt><strong><a name="logfile_file" class="item"><strong>--logfile</strong>=<em>FILE</em></a></strong></dt> | |
426 | ||
427 | <dd> | |
428 | <p>Log message in <em>FILE</em> (implies File logger backend)</p> | |
429 | </dd> | |
430 | <dt><strong><a name="logfile_maxsize_file" class="item"><strong>--logfile-maxsize</strong>=<em>FILE</em></a></strong></dt> | |
431 | ||
432 | <dd> | |
433 | <p>Max logfile size in MB, default is unlimited. When the max size is reached, the | |
434 | file is truncated. This is only useful if there is no log rotation mechanism on | |
435 | the system.</p> | |
436 | </dd> | |
437 | <dt><strong><a name="logfacility_facility" class="item"><strong>--logfacility</strong>=<em>FACILITY</em></a></strong></dt> | |
438 | ||
439 | <dd> | |
440 | <p>Syslog facility to use (default LOG_USER)</p> | |
441 | </dd> | |
442 | <dt><strong><a name="color" class="item"><strong>--color</strong></a></strong></dt> | |
443 | ||
444 | <dd> | |
445 | <p>Display color on the terminal, when the Stderr backend is used.</p> | |
446 | <p>This options is ignored on Windows.</p> | |
447 | </dd> | |
448 | </dl> | |
449 | <p> | |
450 | </p> | |
451 | <h2><a name="configuration_options">Configuration options</a></h2> | |
452 | <dl> | |
453 | <dt><strong><a name="conf_file_file" class="item"><strong>--conf-file</strong>=<em>FILE</em></a></strong></dt> | |
454 | ||
455 | <dd> | |
456 | <p>Use <em>FILE</em> as configuration file (implies file configuration backend)</p> | |
457 | </dd> | |
458 | <dt><strong><a name="config_backend" class="item"><strong>--config</strong>=<em>BACKEND</em></a></strong></dt> | |
459 | ||
460 | <dd> | |
461 | <p>Configuration backend to use. It can be:</p> | |
462 | <dl> | |
463 | <dt> | |
464 | <dd> | |
465 | <p>file: read configuration from a file (default anywhere else as Windows)</p> | |
466 | </dd> | |
467 | <dt> | |
468 | <dd> | |
469 | <p>registry: read configuration from the registry (default on Windows)</p> | |
470 | </dd> | |
471 | <dt> | |
472 | <dd> | |
473 | <p>none: don't read any configuration</p> | |
474 | </dd> | |
475 | </dl> | |
476 | </dd> | |
477 | </dl> | |
478 | <p> | |
479 | </p> | |
480 | <h2><a name="execution_mode_options">Execution mode options</a></h2> | |
481 | <dl> | |
482 | <dt><strong><a name="d_daemon" class="item"><strong>-d</strong>, <strong>--daemon</strong></a></strong></dt> | |
483 | ||
484 | <dd> | |
485 | <p>Run the agent as a daemon.</p> | |
486 | </dd> | |
487 | <dt><strong><a name="no_fork" class="item"><strong>--no-fork</strong></a></strong></dt> | |
488 | ||
489 | <dd> | |
490 | <p>Don't fork in background.</p> | |
491 | <p>This is only useful when running as a daemon.</p> | |
492 | </dd> | |
493 | <dt><strong><a name="debug" class="item"><strong>--debug</strong></a></strong></dt> | |
494 | ||
495 | <dd> | |
496 | <p>Turn the debug mode on.</p> | |
497 | </dd> | |
498 | <dt><strong><a name="setup" class="item"><strong>--setup</strong></a></strong></dt> | |
499 | ||
500 | <dd> | |
501 | <p>Print the agent setup directories and exit.</p> | |
502 | </dd> | |
503 | <dt><strong><a name="version" class="item"><strong>--version</strong></a></strong></dt> | |
504 | ||
505 | <dd> | |
506 | <p>Print the version and exit.</p> | |
507 | </dd> | |
508 | </dl> | |
509 | <p> | |
510 | </p> | |
511 | <hr /> | |
512 | <h1><a name="configuration">CONFIGURATION</a></h1> | |
513 | <p>The agent is able to use multiple configuration backends. The registry backend | |
514 | is the default on Windows platform, and the file backend is the default | |
515 | everywhere else. Another backend can be specified using the <strong>--config</strong> option.</p> | |
516 | <p>The <em>file</em> backend reads configuration directives from a configuration file, | |
517 | whose default location is determined at installation time as | |
518 | PREFIX/etc/agent.cfg. An alternative location can also be given with | |
519 | <strong>--conf-file</strong> option.</p> | |
520 | <p>The <em>registry</em> backend reads configuration directives from the Windows | |
521 | registry, with an arch-dependant location:</p> | |
522 | <ul> | |
523 | <li><strong><a name="hkey_local_machine_software_fusioninventory_agent_for_32_bits_machines" class="item"><em class="file">HKEY_LOCAL_MACHINE\SOFTWARE\FusionInventory-Agent</em> for 32 bits machines</a></strong> | |
524 | ||
525 | </li> | |
526 | <li><strong><a name="hkey_local_machine_software_wow6432node_fusioninventory_agent_for_64_bits_machines" class="item"><em class="file">HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\FusionInventory-Agent</em> for 64 bits machines</a></strong> | |
527 | ||
528 | </li> | |
529 | </ul> | |
530 | <p>The <em>none</em> backend doesn't read any configuration directive at all, allowing | |
531 | to isolate the agent execution from any installed configuration.</p> | |
532 | ||
533 | </body> | |
534 | ||
535 | </html> |
13 | 13 | 'delaytime' => 3600, |
14 | 14 | 'backend-collect-timeout' => 30, |
15 | 15 | 'httpd-port' => 62354, |
16 | 'timeout' => 180, | |
16 | 17 | }; |
17 | 18 | |
18 | 19 | my $deprecated = { |
43 | 43 | $battery->{DATE} = _parseDate($info->{'Manufacture Date'}); |
44 | 44 | } |
45 | 45 | |
46 | if ($info->{Capacity} && $info->{Capacity} =~ /(\d+) \s m(W|A)h$/x) { | |
46 | if ($info->{'Design Capacity'} && | |
47 | $info->{'Design Capacity'} =~ /(\d+) \s m(W|A)h$/x) { | |
47 | 48 | $battery->{CAPACITY} = $1; |
48 | 49 | } |
49 | 50 | |
50 | if ($info->{Voltage} && $info->{Voltage} =~ /(\d+) \s mV$/x) { | |
51 | if ($info->{'Design Voltage'} && | |
52 | $info->{'Design Voltage'} =~ /(\d+) \s mV$/x) { | |
51 | 53 | $battery->{VOLTAGE} = $1; |
52 | 54 | } |
53 | 55 |
29 | 29 | |
30 | 30 | |
31 | 31 | ### mem convert it to meg's if it comes back in gig's |
32 | my $mem = $sysprofile->{'Memory'}; | |
32 | my $mem = $sysprofile->{'Hardware'}{'Hardware Overview'}{'Memory'}; | |
33 | 33 | if ($mem =~ /GB$/){ |
34 | 34 | $mem =~ s/\sGB$//; |
35 | 35 | $mem = ($mem * 1024); |
95 | 95 | |
96 | 96 | my $cores = |
97 | 97 | $info->{'Total Number Of Cores'} ? $info->{'Total Number Of Cores'} / $procs : |
98 | 1 ; | |
98 | $info->{'machdep.cpu.core_count'}; | |
99 | ||
100 | my $threads = $info->{'machdep.cpu.thread_count'}; | |
101 | ||
99 | 102 | |
100 | 103 | my $manufacturer = |
101 | 104 | $type =~ /Intel/i ? "Intel" : |
107 | 110 | CORE => $cores, |
108 | 111 | MANUFACTURER => $manufacturer, |
109 | 112 | NAME => $type, |
110 | THREAD => 1, | |
113 | THREAD => $threads, | |
111 | 114 | FAMILYNUMBER => $family, |
112 | 115 | MODEL => $model, |
113 | 116 | STEPPING => $stepping, |
118 | 121 | push @cpus, $cpu; |
119 | 122 | } |
120 | 123 | |
121 | return $cpu; | |
124 | return @cpus; | |
122 | 125 | |
123 | 126 | } |
124 | 127 |
35 | 35 | # get additional informations |
36 | 36 | foreach (`diskutil list`) { |
37 | 37 | # partition identifiers look like disk0s1 |
38 | next unless /(disk \d+ s \d+)$/; | |
38 | next unless /(disk \d+ s \d+)$/x; | |
39 | 39 | my $id = $1; |
40 | 40 | my $name = "/dev/$1"; |
41 | 41 | |
42 | my $filesystem = $filesystems{$name}; | |
43 | next unless $filesystem; | |
44 | ||
42 | 45 | my $device; |
43 | 46 | foreach (`diskutil info $id`) { |
44 | next unless /^\s+(.*?):\s*(\S.*)/; | |
47 | next unless /(\S[^:]+) : \s+ (\S.*\S)/x; | |
45 | 48 | $device->{$1} = $2; |
46 | 49 | } |
47 | 50 | |
48 | 51 | my $size; |
49 | if ($device->{'Total Size'} =~ /^(.*) \s \(/x) { | |
52 | if ($device->{'Total Size'} =~ /^([.\d]+ \s \S+)/x) { | |
50 | 53 | $size = getCanonicalSize($1); |
51 | 54 | } |
52 | 55 | |
53 | $filesystems{$name}->{TOTAL} = $size; | |
54 | $filesystems{$name}->{SERIAL} = $device->{'Volume UUID'} || | |
55 | $device->{'UUID'}; | |
56 | $filesystems{$name}->{FILESYSTEM} = $device->{'File System'} || | |
57 | $device->{'Partition Type'}; | |
58 | $filesystems{$name}->{LABEL} = $device->{'Volume Name'}; | |
56 | $filesystem->{TOTAL} = $size; | |
57 | $filesystem->{SERIAL} = $device->{'Volume UUID'} || | |
58 | $device->{'UUID'}; | |
59 | $filesystem->{FILESYSTEM} = $device->{'File System'} || | |
60 | $device->{'Partition Type'}; | |
61 | $filesystem->{LABEL} = $device->{'Volume Name'}; | |
59 | 62 | } |
60 | 63 | |
61 | 64 | # add filesystems to the inventory |
0 | package FusionInventory::Agent::Task::Inventory::Input::Virtualization::Lxc; | |
1 | ||
2 | # Authors: Egor Shornikov <se@wbr.su>, Egor Morozov <akrus@flygroup.st> | |
3 | # License: GPLv2+ | |
4 | ||
5 | use strict; | |
6 | use warnings; | |
7 | ||
8 | use FusionInventory::Agent::Tools; | |
9 | ||
10 | sub isEnabled { | |
11 | return canRun('lxc-ls'); | |
12 | } | |
13 | ||
14 | sub doInventory { | |
15 | my (%params) = @_; | |
16 | ||
17 | my $inventory = $params{inventory}; | |
18 | my $logger = $params{inventory}; | |
19 | ||
20 | my $vms = _getVirtualMachines( command => '/usr/bin/lxc-ls -1', logger => $logger ); | |
21 | foreach my $vm ( keys %{$vms}) { | |
22 | ||
23 | my $state = _getVirtualMachineState( command => "/usr/bin/lxc-info -n $vm", logger => $logger ); | |
24 | my $conf = _getVirtualMachineConfig( file => "/var/lib/lxc/$vm/config", logger => $logger ); | |
25 | ||
26 | my %entry = (); | |
27 | $entry{'NAME'} = $vm; | |
28 | $entry{'VMTYPE'} = 'LXC'; | |
29 | $entry{'VMID'} = $state->{'VMID'}; | |
30 | $entry{'STATUS'} = $state->{'STATUS'}; | |
31 | $entry{'VCPU'} = $conf->{'VCPU'}; | |
32 | $entry{'MEMORY'} = $conf->{'MEMORY'}; | |
33 | ||
34 | $inventory->addEntry( | |
35 | section => 'VIRTUALMACHINES', entry => \%entry | |
36 | ); | |
37 | } | |
38 | } | |
39 | ||
40 | sub _getVirtualMachineState { | |
41 | my (%params) = ( | |
42 | @_ | |
43 | ); | |
44 | ||
45 | my ( %state, %info ); | |
46 | ||
47 | my $handle = getFileHandle( %params ); | |
48 | return unless $handle; | |
49 | while( <$handle> ){ | |
50 | chomp; | |
51 | if( $_ =~ m/^(\S+):\s*(\S+)$/ ){ $info{$1} = $2; } | |
52 | } | |
53 | close $handle; | |
54 | ||
55 | $state{'VMID'} = $info{'pid'}; | |
56 | if ( $info{'state'} eq 'RUNNING' ){ | |
57 | $state{'STATUS'} = lc( $info{'state'} ); | |
58 | } elsif ( $info{'state'} eq 'FROZEN' ){ | |
59 | $state{'STATUS'} = 'paused'; | |
60 | } elsif ( $info{'state'} eq 'STOPPED' ){ | |
61 | $state{'STATUS'} = 'off'; | |
62 | } else { | |
63 | $state{'STATUS'} = $info{'state'}; | |
64 | } | |
65 | ||
66 | return \%state; | |
67 | } | |
68 | ||
69 | sub _getVirtualMachineConfig { | |
70 | my (%params) = ( | |
71 | @_ | |
72 | ); | |
73 | ||
74 | my %conf = (); | |
75 | ||
76 | my $handle = getFileHandle( %params ); | |
77 | return unless $handle; | |
78 | while( <$handle> ){ | |
79 | chomp; | |
80 | s/^\s*//g; | |
81 | s/\s*$//g; | |
82 | s/^#.*//g; | |
83 | if ( $_ =~ m/^(\S+)\s*=\s*(\S+)\s*$/ ){ | |
84 | my $key = $1; | |
85 | my $val = $2; | |
86 | if ( $key eq 'lxc.network.hwaddr' ){ $conf{'MAC'} = $val; } | |
87 | if ( $key eq 'lxc.cgroup.memory.limit_in_bytes' ){ $conf{'MEMORY'} = $val; } | |
88 | if ( $key eq 'lxc.cgroup.cpuset.cpus' ){ | |
89 | ###eg: lxc.cgroup.cpuset.cpus = 0,3-5,7,2,1 | |
90 | my $cpu_num = 0; | |
91 | foreach my $cpu ( split( /,/, $val ) ){ | |
92 | if ( $cpu =~ /(\d+)-(\d+)/ ){ | |
93 | my @tmp = ($1..$2); | |
94 | $cpu_num += $#tmp + 1; | |
95 | } else { | |
96 | $cpu_num += 1; | |
97 | } | |
98 | } | |
99 | $conf{'VCPU'} = $cpu_num; | |
100 | } | |
101 | } | |
102 | } | |
103 | close $handle; | |
104 | ||
105 | return \%conf; | |
106 | } | |
107 | ||
108 | sub _getVirtualMachines { | |
109 | my (%params) = ( | |
110 | @_ | |
111 | ); | |
112 | ||
113 | my %vms = (); | |
114 | ||
115 | my $handle = getFileHandle( %params ); | |
116 | return unless $handle; | |
117 | ||
118 | while( <$handle> ){ | |
119 | chomp; | |
120 | unless ( m/^(\S+)$/ ){ next; } | |
121 | $vms{$1} = 1; | |
122 | } | |
123 | close $handle; | |
124 | ||
125 | return \%vms; | |
126 | } | |
127 | ||
128 | 1; |
183 | 183 | } |
184 | 184 | return $result if $result; |
185 | 185 | |
186 | # OpenVZ | |
187 | if (-f '/proc/self/status') { | |
188 | my $handle = getFileHandle( | |
189 | file => '/proc/self/status', | |
190 | logger => $logger | |
191 | ); | |
192 | while (my $line = <$handle>) { | |
193 | my ( $varID, $varValue ) = split( ":", $line ); | |
194 | $result = "Virtuozzo" if ( $varID eq 'envID' && $varValue > 0 ); | |
195 | } | |
196 | } | |
197 | return $result if $result; | |
198 | ||
186 | 199 | return 'Physical'; |
187 | 200 | } |
188 | 201 |
32 | 32 | file => $file, |
33 | 33 | pattern => qr/^N:(\S+)/ |
34 | 34 | ); |
35 | next unless $device; | |
35 | 36 | next unless $device =~ /([hsv]d[a-z]|sr\d+)$/; |
36 | 37 | push (@devices, _parseUdevEntry( |
37 | 38 | logger => $params{logger}, file => $file, device => $device |
199 | 200 | my %seen; |
200 | 201 | @names = grep { !$seen{$_}++ } @names; |
201 | 202 | |
202 | # extract informations | |
203 | # extract information | |
203 | 204 | my @devices; |
204 | 205 | foreach my $name (@names) { |
205 | 206 | my $device = { |
463 | 464 | |
464 | 465 | =head2 getInfoFromSmartctl(%params) |
465 | 466 | |
466 | Returns some informations about a drive, using smartctl. | |
467 | Returns some information about a drive, using smartctl. | |
467 | 468 | |
468 | 469 | Availables parameters: |
469 | 470 |
281 | 281 | sub _build_detailed_timing { |
282 | 282 | my ($pixel_clock, $vv) = @_; |
283 | 283 | |
284 | my $h = get_many_bits($vv, 'detailed_timing'); | |
284 | my $h = _get_many_bits($vv, 'detailed_timing'); | |
285 | 285 | $h->{pixel_clock} = $pixel_clock / 100; # to have it in MHz |
286 | 286 | my %detailed_timing_field_size = map { $_->[1], $_->[0] } @{$subfields{detailed_timing}}; |
287 | 287 | foreach my $field (keys %detailed_timing_field_size) { |
300 | 300 | '4/3', '5/4', '16/9', |
301 | 301 | ); |
302 | 302 | $v = [ map { |
303 | my $h = get_many_bits($_, 'standard_timing'); | |
303 | my $h = _get_many_bits($_, 'standard_timing'); | |
304 | 304 | $h->{X} = ($h->{X} + 31) * 8; |
305 | 305 | if ($_ ne "\x20\x20" && $h->{X} > 256) { # cf VALID_TIMING in Xorg edid.h |
306 | 306 | $h->{vfreq} += 60; |
425 | 425 | $dtd_offset -= 4; |
426 | 426 | |
427 | 427 | while ($dtd_offset > 0) { |
428 | my $h = get_many_bits($v, 'cea_data_block_collection'); | |
428 | my $h = _get_many_bits($v, 'cea_data_block_collection'); | |
429 | 429 | $dtd_offset -= $h->{size} + 1; |
430 | 430 | |
431 | 431 | my $vv; |
433 | 433 | if ($h->{type} == 0x02) { # Video Data Block |
434 | 434 | my @vmodes = unpack("a" x $h->{size}, $vv); |
435 | 435 | foreach my $vmode (@vmodes) { |
436 | $h = get_many_bits($vmode, 'cea_video_data_block'); | |
436 | $h = _get_many_bits($vmode, 'cea_video_data_block'); | |
437 | 437 | my $cea_mode = $cea_video_modes[$h->{mode} - 1]; |
438 | 438 | if (!$cea_mode) { |
439 | 439 | warn "parse_edid: unhandled CEA mode $h->{mode}\n" if $verbose; |
503 | 503 | if ($error < 1 && $in_cm{vertical}) { |
504 | 504 | # using it for the ratio |
505 | 505 | $edid{ratio} = $in_cm{horizontal} / $in_cm{vertical}; |
506 | $edid{ratio_name} = ratio_name($in_cm{horizontal}, $in_cm{vertical}, 'mm'); | |
506 | $edid{ratio_name} = _ratio_name($in_cm{horizontal}, $in_cm{vertical}, 'mm'); | |
507 | 507 | $edid{ratio_precision} = 'mm'; |
508 | 508 | } |
509 | 509 | |
532 | 532 | $h->{pixel_clock} / $horizontal_total / $vertical_total * 1000 * 1000 * ($h->{interlaced} ? 2 : 1), |
533 | 533 | $h->{pixel_clock} / $horizontal_total * 1000, |
534 | 534 | $h->{interlaced} ? "interlaced, " : '', |
535 | nearest_ratio($h->{horizontal_active} / $h->{vertical_active}, 0.01) || sprintf("%.2f", $h->{horizontal_active} / $h->{vertical_active}), | |
535 | _nearest_ratio($h->{horizontal_active} / $h->{vertical_active}, 0.01) || sprintf("%.2f", $h->{horizontal_active} / $h->{vertical_active}), | |
536 | 536 | $dpi_string ? ", $dpi_string" : ''; |
537 | 537 | |
538 | 538 | $h->{ModeLine} = sprintf qq("%dx%d" $h->{pixel_clock} %d %d %d %d %d %d %d %d %shsync %svsync%s), |
17 | 17 | qw/KEY_READ/ |
18 | 18 | ); |
19 | 19 | |
20 | use File::Temp (); | |
21 | use File::Temp qw(:seekable); | |
20 | use File::Temp qw(:seekable tempfile); | |
22 | 21 | use Win32::Job; |
22 | ||
23 | use Cwd; | |
23 | 24 | |
24 | 25 | Win32::OLE->Option(CP => Win32::OLE::CP_UTF8); |
25 | 26 | |
165 | 166 | my $buff = File::Temp->new(); |
166 | 167 | my $void = File::Temp->new(); |
167 | 168 | |
169 | my $winCwd = Cwd::getcwd(); | |
170 | $winCwd =~ s{/}{\\}g; | |
171 | ||
172 | my ($fh, $filename) = File::Temp::tempfile( "$ENV{TEMP}\\fusinvXXXXXXXXXXX", SUFFIX => '.bat'); | |
173 | print $fh "cd \"".$winCwd."\"\r\n"; | |
174 | print $fh $params{command}."\r\n"; | |
175 | print $fh "exit %ERRORLEVEL%\r\n"; | |
176 | close $fh; | |
177 | ||
168 | 178 | my $args = { |
169 | 179 | stdout => $buff, |
170 | 180 | stderr => $params{no_stderr} ? $void : $buff, |
172 | 182 | }; |
173 | 183 | |
174 | 184 | $job->spawn( |
175 | "$ENV{SYSTEMROOT}/system32/cmd.exe", | |
176 | "cmd.exe /c $params{command}", | |
185 | "$ENV{SYSTEMROOT}\\system32\\cmd.exe", | |
186 | "start /wait cmd /c $filename", | |
177 | 187 | $args |
178 | 188 | ); |
179 | 189 | |
180 | 190 | $job->run($params{timeout}); |
191 | unlink($filename); | |
181 | 192 | |
182 | 193 | $buff->seek(0, SEEK_SET); |
183 | 194 |
126 | 126 | |
127 | 127 | return 400 if $speed =~ /^PC3200U/; |
128 | 128 | |
129 | return undef unless $speed =~ /^([\,\.\d]+) \s? (\S+)$/x; | |
129 | return undef unless $speed =~ /^([,.\d]+) \s? (\S+)$/x; | |
130 | 130 | my $value = $1; |
131 | 131 | my $unit = lc($2); |
132 | 132 | |
145 | 145 | |
146 | 146 | return $size if $size =~ /^\d+$/; |
147 | 147 | |
148 | return undef unless $size =~ /^(\d+) \s (\S+)$/x; | |
148 | return undef unless $size =~ /^([,.\d]+) \s? (\S+)$/x; | |
149 | 149 | my $value = $1; |
150 | 150 | my $unit = lc($2); |
151 | 151 |
21 | 21 | use FusionInventory::Agent::Tools::Hostname; |
22 | 22 | use FusionInventory::Agent::XML::Query::Prolog; |
23 | 23 | |
24 | our $VERSION = '2.2.1'; | |
24 | our $VERSION = '2.2.3'; | |
25 | 25 | our $VERSION_STRING = |
26 | 26 | "FusionInventory unified agent for UNIX, Linux and MacOSX ($VERSION)"; |
27 | 27 | our $AGENT_STRING = |
217 | 217 | if ($target->isa('FusionInventory::Agent::Target::Server')) { |
218 | 218 | my $client = FusionInventory::Agent::HTTP::Client::OCS->new( |
219 | 219 | logger => $self->{logger}, |
220 | timeout => $self->{timeout}, | |
220 | 221 | user => $self->{config}->{user}, |
221 | 222 | password => $self->{config}->{password}, |
222 | 223 | proxy => $self->{config}->{proxy}, |
0 | lxc.utsname = name1 | |
1 | lxc.network.type = veth | |
2 | lxc.network.flags = up | |
3 | lxc.network.link = br0 | |
4 | lxc.network.ipv4 = 0.0.0.0 | |
5 | lxc.network.hwaddr = 01:23:45:67:89:0A | |
6 | ||
7 | lxc.cgroup.memory.limit_in_bytes = 2048000 | |
8 | lxc.cgroup.cpuset.cpus = 0,3-5 | |
9 | ||
10 | lxc.tty = 4 | |
11 | lxc.pts = 1024 | |
12 | lxc.rootfs = /var/lib/lxc/name1/rootfs | |
13 | lxc.mount = /var/lib/lxc/name1/fstab | |
14 | lxc.arch = | |
15 | ||
16 | lxc.cgroup.devices.deny = a | |
17 | # /dev/null and zero | |
18 | lxc.cgroup.devices.allow = c 1:3 rwm | |
19 | lxc.cgroup.devices.allow = c 1:5 rwm | |
20 | # consoles | |
21 | lxc.cgroup.devices.allow = c 5:1 rwm | |
22 | lxc.cgroup.devices.allow = c 5:0 rwm | |
23 | #lxc.cgroup.devices.allow = c 4:0 rwm | |
24 | #lxc.cgroup.devices.allow = c 4:1 rwm | |
25 | # /dev/{,u}random | |
26 | lxc.cgroup.devices.allow = c 1:9 rwm | |
27 | lxc.cgroup.devices.allow = c 1:8 rwm | |
28 | lxc.cgroup.devices.allow = c 136:* rwm | |
29 | lxc.cgroup.devices.allow = c 5:2 rwm | |
30 | # rtc | |
31 | lxc.cgroup.devices.allow = c 254:0 rwm | |
32 | #fuse | |
33 | lxc.cgroup.devices.allow = c 10:229 rwm |
9 | 9 | |
10 | 10 | use FusionInventory::Agent::Tools; |
11 | 11 | |
12 | use Test::More tests => 42; | |
12 | use Test::More tests => 27; | |
13 | 13 | |
14 | 14 | my ($out, $err, $rc); |
15 | 15 | |
44 | 44 | my $base_options = "--stdout --debug --no-task ocsdeploy,wakeonlan,snmpquery,netdiscovery"; |
45 | 45 | |
46 | 46 | my $content; |
47 | ||
47 | 48 | # first inventory |
48 | 49 | ($out, $err, $rc) = run_agent( |
49 | 50 | "$base_options --no-category printer" |
50 | 51 | ); |
51 | ok($rc == 0, 'exit status'); | |
52 | ||
53 | unlike( | |
54 | $err, | |
55 | qr/module \S+ disabled: failure to load/, | |
56 | 'no broken module' | |
57 | ); | |
58 | ||
59 | like( | |
60 | $out, | |
61 | qr/^<\?xml version="1.0" encoding="UTF-8" \?>/, | |
62 | 'output has correct encoding' | |
63 | ); | |
64 | ||
65 | $content = XML::TreePP->new()->parse($out); | |
66 | ok($content, 'output is valid XML'); | |
52 | ||
53 | subtest "first inventory" => sub { | |
54 | check_execution_ok($out, $err, $rc); | |
55 | }; | |
67 | 56 | |
68 | 57 | ok( |
69 | 58 | exists $content->{REQUEST}->{CONTENT}->{SOFTWARES}, |
79 | 68 | ($out, $err, $rc) = run_agent( |
80 | 69 | "$base_options --no-category printer,software" |
81 | 70 | ); |
82 | ok($rc == 0, 'exit status'); | |
83 | ||
84 | unlike( | |
85 | $err, | |
86 | qr/module \S+ disabled: failure to load/, | |
87 | 'no broken module' | |
88 | ); | |
89 | ||
90 | like( | |
91 | $out, | |
92 | qr/^<\?xml version="1.0" encoding="UTF-8" \?>/, | |
93 | 'output has correct encoding' | |
94 | ); | |
95 | ||
96 | $content = XML::TreePP->new()->parse($out); | |
97 | ok($content, 'output is valid XML'); | |
71 | ||
72 | subtest "first inventory" => sub { | |
73 | check_execution_ok($out, $err, $rc); | |
74 | }; | |
98 | 75 | |
99 | 76 | ok( |
100 | 77 | !exists $content->{REQUEST}->{CONTENT}->{SOFTWARES}, |
121 | 98 | </REQUEST> |
122 | 99 | EOF |
123 | 100 | close($file); |
101 | ||
124 | 102 | ($out, $err, $rc) = run_agent( |
125 | 103 | "$base_options --no-category printer,software --additional-content $file" |
126 | 104 | ); |
127 | ok($rc == 0, 'exit status'); | |
128 | ||
129 | unlike( | |
130 | $err, | |
131 | qr/module \S+ disabled: failure to load/, | |
132 | 'no broken module' | |
133 | ); | |
134 | ||
135 | like( | |
136 | $out, | |
137 | qr/^<\?xml version="1.0" encoding="UTF-8" \?>/, | |
138 | 'output has correct encoding' | |
139 | ); | |
140 | ||
141 | $content = XML::TreePP->new()->parse($out); | |
142 | ok($content, 'output is valid XML'); | |
105 | subtest "first inventory" => sub { | |
106 | check_execution_ok($out, $err, $rc); | |
107 | }; | |
143 | 108 | |
144 | 109 | ok( |
145 | 110 | exists $content->{REQUEST}->{CONTENT}->{SOFTWARES}, |
170 | 135 | ($out, $err, $rc) = run_agent( |
171 | 136 | "$base_options --no-category printer,software" |
172 | 137 | ); |
173 | ok($rc == 0, 'exit status'); | |
174 | ||
175 | unlike( | |
176 | $err, | |
177 | qr/module \S+ disabled: failure to load/, | |
178 | 'no broken module' | |
179 | ); | |
180 | ||
181 | like( | |
182 | $out, | |
183 | qr/^<\?xml version="1.0" encoding="UTF-8" \?>/, | |
184 | 'output has correct encoding' | |
185 | ); | |
186 | ||
187 | $content = XML::TreePP->new()->parse($out); | |
188 | ok($content, 'output is valid XML'); | |
138 | ||
139 | subtest "first inventory" => sub { | |
140 | check_execution_ok($out, $err, $rc); | |
141 | }; | |
189 | 142 | |
190 | 143 | ok( |
191 | 144 | !exists $content->{REQUEST}->{CONTENT}->{SOFTWARES}, |
208 | 161 | ($out, $err, $rc) = run_agent( |
209 | 162 | "$base_options --no-category printer,software,environment" |
210 | 163 | ); |
211 | ok($rc == 0, 'exit status'); | |
212 | ||
213 | unlike( | |
214 | $err, | |
215 | qr/module \S+ disabled: failure to load/, | |
216 | 'no broken module' | |
217 | ); | |
218 | ||
219 | like( | |
220 | $out, | |
221 | qr/^<\?xml version="1.0" encoding="UTF-8" \?>/, | |
222 | 'output has correct encoding' | |
223 | ); | |
224 | ||
225 | $content = XML::TreePP->new()->parse($out); | |
226 | ok($content, 'output is valid XML'); | |
164 | ||
165 | subtest "first inventory" => sub { | |
166 | check_execution_ok($out, $err, $rc); | |
167 | }; | |
227 | 168 | |
228 | 169 | ok( |
229 | 170 | !exists $content->{REQUEST}->{CONTENT}->{SOFTWARES}, |
244 | 185 | ); |
245 | 186 | return ($out, $err, $CHILD_ERROR >> 8); |
246 | 187 | } |
188 | ||
189 | sub check_execution_ok { | |
190 | my ($client, $url) = @_; | |
191 | ||
192 | ok($rc == 0, 'exit status'); | |
193 | ||
194 | unlike( | |
195 | $err, | |
196 | qr/module \S+ disabled: failure to load/, | |
197 | 'no broken module (loading)' | |
198 | ); | |
199 | ||
200 | unlike( | |
201 | $err, | |
202 | qr/unexpected error in \S+/, | |
203 | 'no broken module (execution)' | |
204 | ); | |
205 | ||
206 | like( | |
207 | $out, | |
208 | qr/^<\?xml version="1.0" encoding="UTF-8" \?>/, | |
209 | 'output has correct encoding' | |
210 | ); | |
211 | ||
212 | $content = XML::TreePP->new()->parse($out); | |
213 | ok($content, 'output is valid XML'); | |
214 | } |
12 | 12 | NAME => 'EV06047', |
13 | 13 | SERIAL => undef, |
14 | 14 | MANUFACTURER => 'LGC-LGC', |
15 | CHEMISTRY => 'Lithium Ion' | |
15 | CHEMISTRY => 'Lithium Ion', | |
16 | VOLTAGE => 10800, | |
17 | CAPACITY => 4400 | |
16 | 18 | }, |
17 | 19 | 'linux-2.6' => { |
18 | 20 | NAME => 'DELL C129563', |
19 | 21 | MANUFACTURER => 'Samsung SDI', |
20 | 22 | SERIAL => undef, |
21 | CHEMISTRY => undef | |
23 | CHEMISTRY => undef, | |
24 | VOLTAGE => 11100, | |
25 | CAPACITY => 48000 | |
22 | 26 | }, |
23 | 27 | 'openbsd-3.7' => undef, |
24 | 28 | 'openbsd-3.8' => undef, |
31 | 35 | SERIAL => '2000417915', |
32 | 36 | DATE => '09/19/2002', |
33 | 37 | MANUFACTURER => 'TOSHIBA', |
34 | CHEMISTRY => 'Lithium Ion' | |
38 | CHEMISTRY => 'Lithium Ion', | |
39 | VOLTAGE => 10800, | |
40 | CAPACITY => 0 | |
35 | 41 | }, |
36 | 42 | 'windows-hyperV' => undef |
37 | 43 | ); |
12 | 12 | CORE => '2', |
13 | 13 | MANUFACTURER => 'Intel', |
14 | 14 | NAME => 'Intel Core 2 Duo', |
15 | THREAD => 1, | |
15 | THREAD => 2, | |
16 | 16 | FAMILYNUMBER => '6', |
17 | 17 | MODEL => '23', |
18 | 18 | STEPPING => '10', |
0 | #!/usr/bin/perl | |
1 | ||
2 | use strict; | |
3 | use warnings; | |
4 | ||
5 | use Test::More; | |
6 | ||
7 | use FusionInventory::Agent::Task::Inventory::Input::Virtualization::Lxc; | |
8 | ||
9 | my $result_lxc_ls = { | |
10 | name2 => 1, | |
11 | name1 => 1, | |
12 | name3 => 1 | |
13 | }; | |
14 | my $result_lxc_info = { | |
15 | STATUS => 'running', | |
16 | VMID => '13018' | |
17 | }; | |
18 | ||
19 | my $result_config = { | |
20 | MEMORY => '2048000', | |
21 | MAC => '01:23:45:67:89:0A', | |
22 | VCPU => 4 | |
23 | }; | |
24 | ||
25 | ||
26 | plan tests => 3; | |
27 | ||
28 | my $vms = FusionInventory::Agent::Task::Inventory::Input::Virtualization::Lxc::_getVirtualMachines(file => 'resources/virtualization/lxc/lxc-ls_-1'); | |
29 | is_deeply($vms, $result_lxc_ls, "lxc-ls -1"); | |
30 | ||
31 | my $state = FusionInventory::Agent::Task::Inventory::Input::Virtualization::Lxc::_getVirtualMachineState(file => 'resources/virtualization/lxc/lxc-info_-n_name1'); | |
32 | is_deeply($state, $result_lxc_info, "lxc-info -n name1 -1"); | |
33 | ||
34 | my $config = FusionInventory::Agent::Task::Inventory::Input::Virtualization::Lxc::_getVirtualMachineConfig(file => 'resources/virtualization/lxc/config'); | |
35 | is_deeply($config, $result_config, "parsing lxc config sample"); |
13 | 13 | ); |
14 | 14 | |
15 | 15 | my @size_tests_ok = ( |
16 | [ '1', 1 ], | |
17 | [ '1 mb', 1 ], | |
18 | [ '1 MB', 1 ], | |
19 | [ '1 gb', 1000 ], | |
20 | [ '1 GB', 1000 ], | |
21 | [ '1 tb', 1000000 ], | |
22 | [ '1 TB', 1000000 ], | |
16 | [ '1' , 1 ], | |
17 | [ '1 mb' , 1 ], | |
18 | [ '1.1 mb', 1.1 ], | |
19 | [ '1 MB' , 1 ], | |
20 | [ '1 gb' , 1000 ], | |
21 | [ '1 GB' , 1000 ], | |
22 | [ '1 tb' , 1000000 ], | |
23 | [ '1 TB' , 1000000 ], | |
23 | 24 | ); |
24 | 25 | |
25 | 26 | my @speed_tests_nok = ( |