OCS Inventory NG Forums

OCS Inventory NG, an OpenSource computer inventory and package deployement system for Windows and Unix

You are not logged in.

#1 2008-01-07 16:25:45

bthylafh
New member
Registered: 2008-01-07
Posts: 1

Error with OCS Mac Agent v4.4

[  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

#2 2008-01-14 20:28:25

jaywagner
New member
From: Arizona
Registered: 2007-04-30
Posts: 1

Re: Error with OCS Mac Agent v4.4

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

#3 2008-01-17 15:56:37

jlo
New member
Registered: 2008-01-16
Posts: 1

Re: Error with OCS Mac Agent v4.4

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

#4 2008-05-29 21:38:02

blooboy
New member
Registered: 2008-05-29
Posts: 2

Re: Error with OCS Mac Agent v4.4

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

#5 2008-06-06 16:09:39

di-net
New member
Registered: 2008-06-06
Posts: 2

Re: Error with OCS Mac Agent v4.4

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

#6 2008-06-09 16:15:52

di-net
New member
Registered: 2008-06-06
Posts: 2

Re: Error with OCS Mac Agent v4.4

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

#7 2008-09-26 13:22:03

Mussolini
New member
From: São Paulo - Brasil
Registered: 2008-09-19
Posts: 6
Website

Re: Error with OCS Mac Agent v4.4

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.

Offline

#8 2008-10-06 09:45:27

NMNI
Member
From: Northern Ireland
Registered: 2008-09-17
Posts: 28

Re: Error with OCS Mac Agent v4.4

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

#9 2008-11-10 09:09:58

mircsicz
New member
Registered: 2008-11-05
Posts: 3

Re: Error with OCS Mac Agent v4.4

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

#10 2008-11-10 19:03:49

jasaroons
New member
From: Seattle, WA, USA
Registered: 2007-11-06
Posts: 8
Website

Re: Error with OCS Mac Agent v4.4

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

#11 2008-11-11 00:17:09

mircsicz
New member
Registered: 2008-11-05
Posts: 3

Re: Error with OCS Mac Agent v4.4

Here's the xml you requested:

http://pastebin.com/m6f77bd03

Thanks in advance

Mircsicz...

Offline

#12 2008-11-21 09:54:35

NMNI
Member
From: Northern Ireland
Registered: 2008-09-17
Posts: 28

Re: Error with OCS Mac Agent v4.4

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

#13 2008-11-21 10:43:26

NMNI
Member
From: Northern Ireland
Registered: 2008-09-17
Posts: 28

Re: Error with OCS Mac Agent v4.4

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.

https://www.math.uwaterloo.ca/mfcf/inte … nfoReport/

Offline

#14 2008-11-21 12:24:57

NMNI
Member
From: Northern Ireland
Registered: 2008-09-17
Posts: 28

Re: Error with OCS Mac Agent v4.4

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

#15 2008-11-21 23:17:50

tpat
New member
Registered: 2008-11-21
Posts: 3

Re: Error with OCS Mac Agent v4.4

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=1000000

The value is in bytes.

Offline

#16 2009-04-17 09:55:42

Buzz
Member
From: Bordeaux, France
Registered: 2009-04-01
Posts: 65
Website

Re: Error with OCS Mac Agent v4.4

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

#17 2009-04-21 00:24:03

sth
Member
Registered: 2009-03-05
Posts: 59

Re: Error with OCS Mac Agent v4.4

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

#18 2009-04-29 13:55:23

Buzz
Member
From: Bordeaux, France
Registered: 2009-04-01
Posts: 65
Website

Re: Error with OCS Mac Agent v4.4

hi sth,
I'm too stupid... I just forgot to put off the semicolon before 'pcre.backtrack_limit=1000000'....
now it's work perfectly wink

Offline

#19 2009-04-30 14:01:02

sth
Member
Registered: 2009-03-05
Posts: 59

Re: Error with OCS Mac Agent v4.4

Not stupid.  I've been there, done that, got the t-shirt as well!

Offline

Board footer

Powered by FluxBB