Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How can I export a list of devices and their info?

We have over 100 devices and it is a pain to have to go through each item indavidually, there has to be a way to export this data or connect to the server some how and query for it.


If all esle fails I can use Curl but it seems backwards to not be able to get this information easily.


Can someone please point me in the right direction.


Thnaks

Derrick

OS X Server

Posted on Dec 17, 2012 12:05 PM

Reply
14 replies

Dec 18, 2012 9:19 AM in response to JaimeMagiera

Jaime, I will try that site again. I could be doing something wrong but evertyime I try to connect as described I always get a Postgres is not running command. I know it has to be since Server.app is using it. Like I said I could be doing it wrong but it seems in the new OSX Server (this site is for Lion which is even before Mountain Lion Server and then became just OSX Server) is running another instance of postgress and hidding it.


I will try again and let you know.

Dec 18, 2012 10:19 AM in response to JaimeMagiera

I thank you for taking your time to help, but either option did not solve my problem.


I get this error,

Server$ psql -U _postgres -d device_management -h 127.0.0.1

psql: could not connect to server: Connection refused

Is the server running on host "127.0.0.1" and accepting

TCP/IP connections on port 5432?



This is the same error I have been getting, I do believe it has somethign to do with the port I think maybe osx server is using another port but I can not find it.

Dec 18, 2012 10:50 AM in response to derrickfromlake elsinore

It’s very easy to corrupt the profile manger when accessing the database so its best make another instance of profile manager for testing purposes, or play around with the dumped file.


My buddy managed to connect to the psql database via command line and even display some data from the Devices table but it was all without proper formatting so it was almost impossible to read.


He said something about “adding roles” to be able to display the data in a more readable format but I didn’t have time to get back to it :/


Maybe this will help anyone:


http://stackoverflow.com/questions/12028037/postgres-app-could-not-start-on-port -5432

Dec 18, 2012 1:35 PM in response to satrab

OK, I am sure I am retrarded and there is a much easier way to do this but I have finally got to the DB to get access to my device list. Call it stubron but I find it stupid that Apple does not allow a simple export of a CSV files or import either for Devices or Users (if there is please let me know).


I am sure there is an easier way, but I am not that savy with permissions or user access so maybe if you can add yourself to _postgres user/group then maybe this is not needed but this is what I had to do.


In this file, /Library/Server/PostgreSQL For Server Services/Config/com.apple.postgres.plist, remove the last 2 elements in the array I believe it is -c and the other locks the port I believe with permissions of 0770. After removeing those two lines, save the file and restart the server.


Then from there you sould be able to connect by

psql -U _postgres -d device_management -h /Library/Server/PostgreSQL\ For\ Server\ Services/Socket



good luck and be carful I am only using this to pull data not input. Please let me know everything I did wrong or anything that could be easier.

How can I export a list of devices and their info?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.