OCS Inventory NG, an OpenSource computer inventory and package deployement system for Windows and Unix
You are not logged in.
It’s been awhile, but I’ve finally managed to get the next release of OCS Mac agent out the door. This release owes all its improvements to patches sent in by users — so thank you to all who contributed! What’s new in version 4.3 for OCS Inventory:
* Better handling of foreign characters. By running the output through utf8_decode foreign characters in the descriptions of the inventory are better handled (Nicolas).
* The hostname command now works even if you have fink installed (Tim).
* SATA drives are correctly handled (Josh).
* The output of the MONITORS section now gives more descriptive (Mark).
* Pragma header is fixed which ensures that inventory results are not cached (Nicolas).
Download it here
If you want to recreate the package yourself (i.e. so you can customize the host file) you can download the source, which can be opened in Package Maker, here
Offline
i tryed and it doesn't work. one thing i think i noticed after i upgraded to Leoprard there was no such folder as /usr/local/sbin . after reinstalling OCS mac agent, this folder was created. and also, when i tryed to run inventory from terminal, i got a permission denied message.
i'm very interested to get it working so i will help as much as i can ![]()
Last edited by Ti:T (2007-11-06 20:31:47)
Offline
Hi,
I've just tryed this new release of OCS Mac Agent, and I've got a little issue on my development'powerbook.
When inventory is done, an error stop him, and no data is sent to the OCS server.
Could not find SPSerialATADataType in system_profiler XML. Corrupted output ?
It append on a PowerBookG4, runing MacOS X Tiger (10.4.10) (and hum... without any SATA drive, yes !).
All ideas are welcome ![]()
Thanks !
Offline
Ti:T - Did you try running the program as root? It does require admin/root permissions to run.
Oustédaisse: I've fixed the bug you found in my development version. Once I can get some info about what is broken for 10.5 I'll release a new version.
Offline
jasaroons wrote:
Ti:T - Did you try running the program as root? It does require admin/root permissions to run.
i used the instructions from this post http://forums.ocsinventory-ng.org/viewtopic.php?id=830 .
when i run sudo /usr/local/sbin/ocs_mac_agent.php i get the following message:
TiiT-mac:~ tiit$ sudo /usr/local/sbin/ocs_mac_agent.php
Password:
[ INFO ] OCS Mac Agent started at Thu, 08 Nov 2007 09:34:08 +0200
[ INFO ] No new update needed for this agent
[ INFO ] Starting inventory of TiiT-mac
[ ERROR ] Could not find SPIDEDataType in system_profiler XML. Corrupted output?
TiiT-mac:~ tiit$
even when i sudo first and then run /usr/local/sbin/ocs_mac_agent.php i get the same message.
also tryed to run php /usr/local/sbin/ocs_mac_agent.php . still the same message. am i doing something wrong?
Offline
Hello,
I am currently deploying your new ocs mac agent and am experiencing an issue with computer dupplication. The root cause of this duplication is the OSX behavour of changing the unix hostname to the hostname given to the computer by a dhcp server. Is there a method of stoping this duplicaiton other than modifying the agent to use "scutil --get ComputerName" instead of "hostname -s".
Thank you,
Ian
Offline
Ti:T - it looks like leopard doesn't have SPIDEDataType -- do you have any IDE drives on that computer?
ianm - I think using scutil is the best way. I plan to work that into the next version.
Offline
jasaroons wrote:
Ti:T - it looks like leopard doesn't have SPIDEDataType -- do you have any IDE drives on that computer?
i'm using a MacBook Pro:
Model Name: MacBook Pro 15"
Model Identifier: MacBookPro2,2
Processor Name: Intel Core 2 Duo
Processor Speed: 2.33 GHz
Boot ROM Version: MBP22.00A5.B07
HDD is SATA:
Intel ICH7-M AHCI:
Vendor: Intel
Product: ICH7-M AHCI
Speed: 1.5 Gigabit
Description: AHCI Version 1.10 Supported
FUJITSU MHW2120BH:
Capacity: 111,79 GB
Model: FUJITSU MHW2120BH
Revision: 00810013
Offline
jasaroons wrote:
Oustédaisse: I've fixed the bug you found in my development version. Once I can get some info about what is broken for 10.5 I'll release a new version.
Thanks a lot ![]()
Offline
Ian,
the way you could do that is put a HOSTNAME="AName" in /etc/hostconfig
drBert
ianm wrote:
Hello,
I am currently deploying your new ocs mac agent and am experiencing an issue with computer dupplication. The root cause of this duplication is the OSX behavour of changing the unix hostname to the hostname given to the computer by a dhcp server. Is there a method of stoping this duplicaiton other than modifying the agent to use "scutil --get ComputerName" instead of "hostname -s".
Thank you,
Ian
Offline
Ti:T wrote:
jasaroons wrote:
Ti:T - Did you try running the program as root? It does require admin/root permissions to run.
i used the instructions from this post http://forums.ocsinventory-ng.org/viewtopic.php?id=830 .
when i run sudo /usr/local/sbin/ocs_mac_agent.php i get the following message:
TiiT-mac:~ tiit$ sudo /usr/local/sbin/ocs_mac_agent.php
Password:
[ INFO ] OCS Mac Agent started at Thu, 08 Nov 2007 09:34:08 +0200
[ INFO ] No new update needed for this agent
[ INFO ] Starting inventory of TiiT-mac
[ ERROR ] Could not find SPIDEDataType in system_profiler XML. Corrupted output?
TiiT-mac:~ tiit$
even when i sudo first and then run /usr/local/sbin/ocs_mac_agent.php i get the same message.
also tryed to run php /usr/local/sbin/ocs_mac_agent.php . still the same message. am i doing something wrong?
I am having a similar problem:
galeras:/usr/local/sbin root# uname -a
Darwin galeras.la.asu.edu 8.11.0 Darwin Kernel Version 8.11.0: Wed Oct 10 18:26:00 PDT 2007; root:xnu-792.24.17~1/RELEASE_PPC Power Macintosh powerpc
galeras:/usr/local/sbin root# id
uid=0(root) gid=0(wheel) groups=0(wheel), 1(daemon), 2(kmem), 3(sys), 4(tty), 29(certusers), 5(operator), 80(admin), 20(staff)
galeras:/usr/local/sbin root# ls -l
total 312
-rwxr-xr-x 1 root wheel 159564 Nov 5 17:48 ocs_mac_agent.php
galeras:/usr/local/sbin root# /usr/local/sbin/ocs_mac_agent.php
[ INFO ] OCS Mac Agent started at Mon, 19 Nov 2007 10:08:14 -0700
[ INFO ] No new update needed for this agent
[ INFO ] Starting inventory of galeras
[ ERROR ] Could not find SPSerialATADataType in system_profiler XML. Corrupted output?
galeras:/usr/local/sbin root#
I don't know where to look for the "system_profiler XML" or I'd post it so you could see whether the output is indeed "corrupted".
Offline
hi to everyone...
I've been poking around with mac agent 4.3 and tiger & leopard... so here are few answers:
I have managed (by coding a modified version) to run mac agent on leopard but to my great disappointment. I have found that many machines running leopard (in french) are suffering from a design flow which prevents system_profiler to run. When exercized from the terminal, `service_profiler -xml` ends with 1) a partial output and 2) a message of this kind:
system_profiler[477:613] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary.
Eventually, this (nasty looking) bug will spill all over the system and users's complaints may well flourish if the problem is not addressed.
Anyway, for machines not suffering from this bug... the agent consistently got them inventoried :)
Ti:T:
the SPIDEDataType problem is due to the design of mac agent. When not launched on tiger, the client assumes that it is running on... an older machine with IDE controller. So there is not much to do except hoping that jason will get leopard really soon :)
msimkim:
from the terminal as an unpriviledge user:
$ system_profiler
will produce a full readable report and
$ system_profiler -xml > myMac.spx
will produce myMac.spx you can exploit by double-clicking it as well as:
$ system_profiler -xml > myMac.xml
from the terminal:
$sudo ocs_mac_agent -help
will produce a usage
$sudo ocs_mac_agent.php -l . -x
will produce a local (readable because uncompressed) inventory xml file... but only if the client succeed
last, a big thanks to jason as his works is really useful and nice!
erik
Offline
Thanks erika, your suggestion worked. I have two XML files which do not look corrupted but maybe are simply missing the section the program is expecting. Anyway I emailed Jason to see if he wants to look at the XML files.
Offline
Is it possible to receive a version with the fix for SPSerialATADataType problem? i have a lot of machines returning this problem.
If you need info on 10.5 machines, let me know, i could run some test for you.
Offline
erika wrote:
hi to everyone...
I've been poking around with mac agent 4.3 and tiger & leopard... so here are few answers:
I have managed (by coding a modified version) to run mac agent on leopard but to my great disappointment. I have found that many machines running leopard (in french) are suffering from a design flow which prevents system_profiler to run. When exercized from the terminal, `service_profiler -xml` ends with 1) a partial output and 2) a message of this kind:
system_profiler[477:613] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary.
Eventually, this (nasty looking) bug will spill all over the system and users's complaints may well flourish if the problem is not addressed.
Anyway, for machines not suffering from this bug... the agent consistently got them inventoried
Does this happen on systems running English versions? Also, is this patched in 4.3, or are we waiting for patches etc for 4.4?
Offline
I've got it running under Leopard (10.5.1) on my system.
It took a bit of messing around in the code, however...
here are my changes that got it working:
--- ocs_mac_agent.php 2007-11-05 19:48:03.000000000 -0500
+++ ocs_leopard.php 2007-12-05 13:57:46.000000000 -0500
@@ -325,5 +325,5 @@
if (!$this->_uncompressed) {
- $s_data = gzcompress(utf8_decode($s_data));
+ $s_data = gzcompress(iconv('UTF-8', 'ASCII//IGNORE', $s_data));
} else {
- $s_data = utf8_decode($s_data);
+ $s_data = iconv('UTF-8', 'ASCII//IGNORE', $s_data);
}
@@ -360,3 +360,3 @@
if ($this->_prolog()) {
- $this->_request->setBody(gzcompress(utf8_decode($this->_inventory())));
+ $this->_request->setBody(gzcompress(iconv('UTF-8', 'ASCII//IGNORE', ($this->_inventory()))));
if (PEAR::isError($this->_request->sendRequest()) || $this->_request->getResponseCode() != 200) {
@@ -735,3 +735,3 @@
$this->_OSXVer = preg_replace('/.*OS X (Server )?([\d\.]+)\s.*/', '\2', $this->_getValByKey('os_version', $this->_profileData));
- $this->_is10_4 = (strpos($this->_OSXVer, '10.4') === 0);
+ $this->_is10_4 = ((strpos($this->_OSXVer, '10.4') === 0) || (strpos($this->_OSXVer, '10.5') === 0));
// Beginning of xmlpretty simple change to get it to recognize 10.5 (the last line)
But my system_profiler was outputting some odd special characters ( copyright symbols, etc) that XAMPP's Parser.pm was choking on, so that's why I changed the utf8_decode lines to iconv (just converts the utf-8 to ascii ignoring anything it can't translate)
edit: Those iconv could probably be left out... looks like my leopard install is corrupt or something...
Hope that helps a little.
No thorough testing, so I don't know if these changes break anything. But my macbook does show up in the inventory now.
Last edited by KaosDG (2007-12-06 15:46:25)
Offline
"Does this happen on systems running English versions?"
regarding the SPIDEDataType in system_profiler XML error.
Yes this does affect English versions also.
Offline
KaosDG,
I tried your hack on a Leopard machine.
I keep getting "Fatal error: Class delarations may not be nested in /usr/local/sbin/ocs_mac_agent.php on line line#"
If I go to the line and remove the entire variable entry then it run it again it just goes to the next inventory dig and gives the same error.
Any suggestions?
Its a Mac Book Pro running 10.5.1.
Offline
Hi all,
I have just deleted the lines concerning "SPIDEDataType" and the section "function _doDrivesAndStorages()" linked to "SPIDEDataType" in ocs_mac_agent.php and reboot the system to get my inventory in GLPI (or re-run ocs_mac_agent.php as root. Do not take care about the error message 500).
Hope this helps.
Cheers,
Olivier
Offline