You are not logged in.
Hi,
I've just install a OCS Inventory management on a Windows XP machine. We already have a inventory soft for our PCS. Working just fine...everything being inventoried into a SQL DB.
We were searching for a inventory soft for our MAC OS X machines. We could have done it with remote desktop and import the infos but we wanted something that could be run by an agent that we could deploy. Think we found that with OCS We are in a test tryouts. Works fine for our Windows PCs but we don't need it for them anyway, maybe for our Linux box PC.
Now for our MACS not so good.
By running in TERMINAL sudo /usr/local/sbin/ocs_mac_agent.php
First try was on a Leopard Powerbook G4 didn't worked....something with SPApplicationDataType not parse in XML.
Went on to X.4 test machines to see if the problem was only with the X.5 machine...
Next one a Mac OS X.4 Server....everything went without any problems.
Next one a Mac OS X.4 iBook....everything OK again.
Now a X.3 test machine...
On a Mac OS X.3 iBook....problems with SPSerialATADataType....error and program stopped.
I've commented the "$this->_doDrivesAndStorages() and $this->_doControllers(); in the OCS_mac_agent.php and it pass thru and got inventoried but without the controllers and hard drive infos. Good infos to have but we could go without it.
Returning on my Leopard Powerbook G4 one....I've commented the "$this->_doSoftwares();" which was stopping the program. We don't need that info anyway Hoping that it will pass thru and at least give me the rest....but nope...at the end it's giving me "Cannot transmit inventory. Response Code: 500" ? NOW WHAT? any idea.
Has someone running it on a Leopard yet? Is it on that piece of material specifically or what? Any ideas welcome.
Offline
I am getting the same error: "Cannot transmit inventory. Response Code: 500" on an OS X.4 server. No problems at all on an Intel iMac or PPC iBook running 10.4.x though. We are not running any Leopard machines yet. I am not sure where to look for the problem on this server but I am more than willing to get info from the box if it will be helpful in troubleshooting.
Offline
I get teh same error on 10.5. The apache logs complain about: "not well-formed (invalid token) at line 1063. Looks like XML::Parser (line 187) doesn't like the XML leopards version of PHP spits out.
Offline
...and I verified that it works FINE in Tiger. It's gatta be the php+xml generation that's throwing it off.
Offline
Looks like it's just a name change with the "parallel scsi" devices. I bet if you went into those functions and translated the output on the way back from the system profiler, you'd be OK.
Offline
Same Problem with Leopard. Dont know how to fix it.
Please help.
Offline
Hi
I've got the same problem.
I found a way to have it running. It is not very clean but it work.
You should activate "remote access" (ssh) on system preferences > shares.
Next open a term and type:
ssh 127.0.0.1
sudo /usr/local/sbin/ocs_mac_agent.php
[Type your password here]
I 'm not sure but it must be a problem with env var witch can be different if you just open a term on the desktop or use a remote connection.
If you want investigate more, you could see it with "set" command or "set | less " for the human readable version
I'll try to do a diff of the output of this command or investigate a bit more when i'll find time for ![]()
Feel free to contact me at gebura AT evilkittens DOT org
Regards,
Mathieu Goessens
Last edited by gebura (2008-02-01 16:47:01)
Offline
Yeahhh this Works!!!!!!
Thanks gebura!!!!
Anyone knows how to automate this for getting work without doing manually???
any other fix too???
Thanks again gebura good work.
Offline
I'm happy if that helped you.
I don't understand why but it don't work on all macs that i tested. ![]()
('ll try to check what is different on those macs)
Edit: It doesn't work on macpro G5 (and maybe also G4 etc )
Please note that if you activate remote access, you or others users may be able to do remote login on your mac.
That must be important if you have a security policy and/or if you password is empty.
( So the better way, must be to unactivate it after informations was send )
(sorry for my poor english !)
Edit: I think Remote access can be activated / unactivated automaticaly with a short script shell. Any mac guru here can tell us how ? ![]()
Bye,
Mathieu Goessens
Last edited by gebura (2008-02-01 16:17:45)
Offline
Well it is not working for me on a Powerbook G4 with mac os x.5.1
Still got the error 500 at the end and no inventory
Offline
Hi
Asked a mac guru and he tell me that:
sudo service ssh start
sudo service ssh stop
can be used instead of using graphical interface.
Edit:
I must be possible to make a short script like (not tested):
#!/bin/sh
sudo service ssh start
ssh 127.0.0.1 sudo /usr/local/sbin/ocs_mac_agent.php
sudo service ssh stop
I should be possible to automate entire process, for that you have to
1) download the .dmg (with wget)
2) mount the .dmg (with mount ?)
3) launch the installer (don't know how, it must be great if there is a kind of quiet installation)
If somebody has some time to loose...
Don't have any idea about a G5/G4 hack.
Regards,
Mathieu Goessens
Last edited by gebura (2008-02-04 16:25:06)
Offline
Great work gebura! I am glad to see that there is progress being made with this error. Unfortunately for me, however, this is still not working on an OS X.4.x server. I am getting the same error: "Cannot transmit inventory. Response Code: 500"
Offline
I get a bug in the local import(from apache):
DBD::mysql::db do failed: Unknown column 'N' in 'field list'
at /usr/local/share/perl/5.8.8/Apache/Ocsinventory/Server/Inventory.pm line 167.
This is the line in question:
$dbh->do("UPDATE hardware SET USERAGENT=".$dbh->quote($ua).",
Alas I don't know how to fix it, but I've also spotted an issue I get on all versions of OS X.
The bit of code causing the problem was it not finding
the 'SPSerialATADataType' section in the system_profiler data dump. So not
being a PHP developer I tried the following code tweak and it works now. I
can import into OCS no problem, well except the above error on a Xserve RackServe.
if (!$result && $in_required && $in_required!='SPSerialATADataType') {
$this->message("Could not find $in_nodeName in system_profiler
XML. Corrupted output?", 'error');
die();
Gabriel G maybe this can give your storage info you are missing.
Last edited by felimwhiteley (2008-02-27 14:32:19)
Offline
Where did you type it ? In the Mac Agent ? Line number ?
if (!$result && $in_required && $in_required!='SPSerialATADataType') {
$this->message("Could not find $in_nodeName in system_profiler
XML. Corrupted output?", 'error');
die();
Offline
Getting an error under Mac OS X 10.5.2 Leopard. The script runs and I end up with [ ERROR ] Could not find SPApplicationsDataType in system_profiler XML. Corrupted output?
It appears that the System Profiler is not returning a column that the agent is looking for. Any work arounds or release of a new package is appreciated.
Thanks
Offline
Same error with quite some OS 10.5 Leopard. The environment variable LC_CTYPE seems to raise the problem. So another workaround is following :
unset LC_CTYPE
sudo /usr/local/sbin/ocs_mac_agent.php
Offline
</array>
</plist>[ ERROR ] Could not find SPApplicationsDataType in system_profiler XML. Corrupted output?
Still the same error occurs after the run completes. These are the last lines of the output.
Offline
These are the results:
Last login: Wed Mar 26 12:31:49 on ttys001
tizona:~ Manny$ env
MANPATH=/usr/share/man:/usr/local/share/man:/usr/X11/man
TERM_PROGRAM=Apple_Terminal
TERM=xterm-color
SHELL=/bin/bash
TMPDIR=/var/folders/eM/eMqzEdE2HgSxRezK-x0oqE+++TI/-Tmp-/
Apple_PubSub_Socket_Render=/tmp/launch-YvLXt2/Render
TERM_PROGRAM_VERSION=240
USER=Manny
COMMAND_MODE=unix2003
SSH_AUTH_SOCK=/tmp/launch-SZXpNl/Listeners
__CF_USER_TEXT_ENCODING=0x1F5:0:0
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
PWD=/Users/Manny
LANG=en_US.UTF-8
SHLVL=1
HOME=/Users/Manny
LOGNAME=Manny
DISPLAY=/tmp/launch-NMy4sb/:0
SECURITYSESSIONID=8a48e0
_=/usr/bin/env
Thanks for your help
Manny
Offline
unset LC_CTYPE
sudo /usr/local/sbin/ocs_mac_agent.phpIndeed its seems that it is not functionnal on G5+Leopard, but works on Core+Leopard.
No G5 with OS X 10.5 have been inventoried ...
Offline
I just saw this thread....
I get 500, and tried the unset command, but still get error code 500.
Mac is running 10.5.2
Offline
Ah...
if I su to root first, then do the unset and run the script directly as root, then it works ok. The sudo method doesn't though...
Offline
FWIW, I'm having trouble with the following setups:
C2D iMac, running 10.5.2 -- Receive Response Code: 500 whenever I try to run the agent manually via the terminal or SSH, but it executes successfully after install (custom post-install script) and on reboot.
G5 iMac, running 10.5.2 -- Agent receives Response Code: 500, no matter how the script is executed (part of install, or reboot).
After spending most of my day working on this, the only theory I can come up with is that there is a bug in either the agent or PHP5 (both?) that is triggered, regardless, on a G5 system and by a unknown environment variable on Intel-based systems. That probably doesn't make any sense, but it's all I can come up with right now. Any thoughts?
Offline
which user are you running as when you run it? Like I said, for me, it wouldnt run until I switched to root. That indicates a permissions issue somewhere.
Offline