You are not logged in.
Pages: 1
[ INFO ] OCS Mac Agent started at Mon, 07 Jan 2008 09:23:49 -0600
Notice: Undefined property: OCS_MacAgent::$_getName in /usr/local/sbin/ocs_mac_agent.php on line 326
[ INFO ] No new update needed for this agent
[ INFO ] Starting inventory of {computer name deleted}
SystemFlippers: didn't consume all data for vers ID 1 (pBase = 0x5e8b00, p = 0x5e8b08, pEnd = 0x5e8b09)
<snip XML output>
[ ERROR ] Could not find SPApplicationsDataType in system_profiler XML. Corrupted output?
This is on a 2.16 GHz Macbook from June 2007 running OSX 10.5.1.
Last edited by bthylafh (2008-01-07 16:26:40)
Offline
Seeing this same error on a MacBook 2,1 running Leopard 10.5.1 and agent 4.4, final report is a '500 error'
Offline
Bonjour,
I get something similar with an iMac and OS X 10.5.1 :
bibou:sbin jlo$ sudo ./ocs_mac_agent.php
Password:
[ INFO ] OCS Mac Agent started at Thu, 17 Jan 2008 15:30:47 +0100
Notice: Undefined property: OCS_MacAgent::$_getName in /usr/local/sbin/ocs_mac_agent.php on line 326
[ INFO ] No new update needed for this agent
[ INFO ] Starting inventory of bibou
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
..... XML Stuff ....
</array>
</plist>[ ERROR ] Cannot transmit inventory. Response Code: 500
On OCS server, I have this error in httpd logs:
[Wed Jan 16 14:12:19 2008] [error] [client 194.254.113.13] \nnot well-formed (invalid token) at line 299, column 30, byte 8768 at /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/XML/Parser.pm line 187\n
Thanks for any information or workaround ...
Offline
I just installed the agent on Leopard Server and got the same error when I ran the PHP script manually - error 500. GRRRRR....
Anyone have a clue?
Thanks in advance,
Brian
Offline
got same error on my macs
on macbook
</plist>[ ERROR ] Cannot transmit inventory. Response Code: 500
and it gives this in apache2 error logs
====================================
[Fri Jun 06 16:59:38 2008] [error] [client x.x.x.x] :827: parser error : Input is not proper UTF-8, indicate encoding !\nBytes: 0xCC 0x6D 0x65 0x6E\n\t\t\t<FOLDER>/Applications/Microsoft Office 2008/Outils supple\xccmentaires/Supprimer\n\t\t\t ^ at /usr/lib/perl5/XML/LibXML/SAX/Parser.pm line 31\n
====================================
resolved for macbook so
unset LANG && /usr/local/sbin/ocs_mac_agent.php
on powerbook G4 it doesn't work yet :-(
Offline
I instaled ocsinventory in my MAC (powerbook g4) il gives me somme errors:
************************** DEBUT ********************************************
Notice: Undefined property: OCS_MacAgent::$_getName in /usr/local/sbin/ocs_mac_agent.php on line 326
[ INFO ] No new update needed for this agent
[ INFO ] Starting inventory of litpc35
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
...
</plist>[ ERROR ] Cannot transmit inventory. Response Code: 500
can you help me plase
Offline
Same error with the following log in /var/log/apache2/error.log:
[Fri Sep 26 09:19:55 2008] [error] [client 192.0.0.19] \nnot well-formed (invalid token) at line 303, column 30, byte 8953 at /usr/local/lib/perl/5.8.8/XML/Parser.pm line 187\n
Thanks.
Danilo Mussolini
http://mussolini.no-ip.org:30000
Offline
I get the SPApplicationsDataType error too on my G5's 10.3 and 10.5
Some G4's give the SPSerialATADataType but this is fixed using a different .php file in another post
Offline
I see the same Error on a MacBook-Pro running 10.5.5 ...
I'll test it on one our 10.4 iMac's today!
Here's what I saw when I ran it on a G5 iMac:
[ OK ] Successfully transmitted inventory
[ INFO ] Account info up to date
[ OK ] Finished. Execution time: 25.56s
I hope we can find a solution for 10.5, I'd like to have our "complete" office inventored!! Especially because we won't support 10.4 in 2009...
Greetz
Mircsicz
P.S.: After I've commented out:
$this->_doSoftwares();
and removed "SPApplicationsDataType" from
exec('/usr/sbin/system_profiler -xml SPNetworkDataType SPPCIDataType SPModemDataType SPMemoryDataType SPUSBDataType SPSCSIDataType SPParallelSCSIDataType SPIDEDataType SPParallelATADataType SPSerialATADataType SPFireWireDataType SPHardwareDataType SPSoftwareDataType SPNetworkDataType SPDisplaysDataType SPPrintersDataType', $a_output, $s_error);
It runs on 10.5.5 too, but sadly doesn't create an inventory from the installed apps...
So the reason for the Error "[ ERROR ] Could not find SPApplicationsDataType in system_profiler XML. Corrupted output?" has to be somewhere in this part of the Code:
function _doSoftwares()
{
$s_node = $this->_getDataNode('SPApplicationsDataType');
preg_match_all('/<dict>.*?<\/dict>/sm', $s_node, $a_matches);
foreach ($a_matches[0] as $i => $s_node) {
preg_match('/(.*)\/(.*)/', $this->_getValByKey('path', $s_node), $a_matches2);
$s_path = $a_matches2[1];
$s_app = $a_matches2[2];
$this->_data['CONTENT']['SOFTWARES'][$i]['PUBLISHER'] = 'N/A';
$this->_data['CONTENT']['SOFTWARES'][$i]['NAME'] = $this->_getValByKey('_name', $s_node);
$this->_data['CONTENT']['SOFTWARES'][$i]['VERSION'] = $this->_getValByKey('version', $s_node);
$this->_data['CONTENT']['SOFTWARES'][$i]['FOLDER'] = $s_path;
$this->_data['CONTENT']['SOFTWARES'][$i]['FILENAME'] = $s_app;
$this->_data['CONTENT']['SOFTWARES'][$i]['COMMENTS'] = $this->_getValByKey('info', $s_node);
$this->_data['CONTENT']['SOFTWARES'][$i]['FILESIZE'] = 0;
$this->_data['CONTENT']['SOFTWARES'][$i]['SOURCE'] = 1;
}
}
But sadly I don't know how to debug the above error, I hope one can tell me how to do so!
Last edited by mircsicz (2008-11-10 10:50:11)
Offline
Hi Mircsicz,
Could you run this from the command line:
/usr/sbin/system_profiler -xml
And post the output? For some reason the software data is missing from the XML in some versions of OSX and I need to see if it's contained in a different section.
-Jason
Offline
Offline
I looked through the ocs_inventory.php thing to see the command for the system profiler:
/usr/sbin/system_profiler -xml SPNetworkDataType SPPCIDataType SPModemDataType SPMemoryDataType SPUSBDataType SPSCSIDataType SPParallelSCSIDataType SPIDEDataType SPParallelATADataType SPSerialATADataType SPFireWireDataType SPHardwareDataType SPSoftwareDataType SPNetworkDataType SPApplicationsDataType SPDisplaysDataType SPPrintersDataType
If I run that and pipe it > /Users/nmni/output.xml
The output just stops after SPIDEDataType!
<key>_items</key>
<array>
<dict>
<key>_name</key>
<string>Macintosh HD</string>
<key>bsd_name</key>
<string>disk0s2</string>
<key>file_system</key>
<string>Journaled HFS+</string>
<key>free_space</key>
<string>198.48 GB</string>
<key>mount_point</key>
<string>/</string>
<key>size</key>
<string>233.76 GB</string>
<key>writable</key>
<string>yes</string>
</dict>
</array>
<key>_name</key>
<string>Maxtor 6Y250M0</string>
<key>bay_name</key>
<string>A (upper)Which means it never gets to SPApplicationsDataType
Offline
I found this when searching for information regarding SPIDEDataType
Running system_profiler -xml SPIDEDataType on a G5 computer produces truncated output. The bug has been reported to Apple (# 3869255). Oddly, this bug also appears to prevent system_profiler on G5s from completing normally when asked for SPIDEDataType output and run in the background. The scripts diagnose the existence of this bug by noticing that the output from system_profiler lacks the end document tag </plist>; the result is that the Drives table is then not updated with IDE data.
Offline
Ok, well I figured out a work around
You need to edit line 755 of /usr/local/sbin/ocs_mac_agent.php
it starts with "exec('/usr/sbin/system_profiler -xml SPNetworkDataType"
Look for SPIDEDataType, and move it from its current position in the command, right to the end, so it should look something like this
exec('/usr/sbin/system_profiler -xml SPNetworkDataType SPApplicationsDataType SPPCIDataType SPModemDataType SPMemoryDataType SPUSBDataType SPSCSIDataType SPParallelSCSIDataType SPParallelATADataType SPSerialATADataType SPFireWireDataType SPHardwareDataType SPSoftwareDataType SPNetworkDataType SPDisplaysDataType SPPrintersDataType SPIDEDataType', $a_output, $s_error);This will mean the IDE devices are checked last. Having it earlier on means xml output stops at SPIDEDataType.
Next, edit line 1235, changing the "die();" to "return '';"
so the full command reads
else {
$this->message("Could not find $in_nodeName in system_profiler XML. Corrupted output?", 'error');
return '';
}Save and run, and that's it. It will complain about the missing IDEDataType and you wont have any Hard Disk or CD/DVD listed in OCS, but its better than nothing
Offline
The problem is with the version of PHP (5.2.x) that is installed with OS X 10.5. There is a new memory limit for perl regular expressions (a little under 100k by default). Since the amount of information collected is huge the script is hitting this limit. Changing the setting for pcre.backtrack_limit in your php.ini file will correct this. This value is in bytes. Here's what I set mine too:
pcre.backtrack_limit=1000000The value is in bytes.
Offline
Hello,
I relunch this topic, 'cause I've the same as you. I've tried tpat's method, but it doesn't change anything.... Anybody has an idea?
thanks
Offline
Buzz, which error are you relunching? This thread discusses several different errors
1. Notice: Undefined property: OCS_MacAgent::$_getName in /usr/local/sbin/ocs_mac_agent.php on line 326
2. [ ERROR ] Cannot transmit inventory. Response Code: 500
3. Some G4's give the SPSerialATADataType but this is fixed using a different .php file in an
Each of these has a different fix. I posted a series of fixes for the codejanitor php agent in another thread. <http://forums.ocsinventory-ng.org/viewtopic.php?id=3820> I recently added one more fix to get it to run on an old 10.3 system with IDE drives.
So please let us know which error you are seeing and which fixes you have applied.
Offline
hi sth,
I'm too stupid... I just forgot to put off the semicolon before 'pcre.backtrack_limit=1000000'....
now it's work perfectly ![]()
Offline
Not stupid. I've been there, done that, got the t-shirt as well!
Offline
Pages: 1