Open-AudIT
https://www.open-audit.org/phpBB3/

Mac Audit
https://www.open-audit.org/phpBB3/viewtopic.php?f=20&t=3678
Page 3 of 4

Author:  el_geto [ Wed Jan 26, 2011 8:09 am ]
Post subject:  Re: Mac Audit

Thanks to one of our Mac experts, I got myself Xcode and started tweaking the script.

I made a change in System02 line to post Model, Type, Serial and Manufacturer.

[code] stringToWrite = [NSString stringWithFormat:@"system02%@%@%@%@ %@ %@ %@%@%@ %@%@%@ %@ %@ %@%@\n", sep, [hwItems objectForKey:@"machine_model"], sep, hostName, sep, sep, sep, sep, [hwItems objectForKey:@"machine_name"], sep, sep, [hwItems objectForKey:@"serial_number"], sep, systemManufacturer, sep, sep, sep, sep];
[/code]

I think I'm getting the hang of this, I'll do some more work and testing and will let you know.
I can see the light at the end of the tunnel!!!
The question now is, what to do about Mac audit for OAv2 :?:

Author:  jpa [ Wed Jan 26, 2011 8:15 am ]
Post subject:  Re: Mac Audit

[quote="el_geto"]The question now is, what to do about Mac audit for OAv2Unfortunately you've just volunteered to modify the script to post OAv2 XML rather than the current format. Data's mostly the same. Shouldn't take more than a couple weeks. :lol:

Author:  Mark [ Wed Jan 26, 2011 10:20 am ]
Post subject:  Re: Mac Audit

Hey - GO FOR IT !
See my reply here - [url]http://www.open-audit.org/phpBB3/viewtopic.php?f=5&t=3997&p=17507#p17507[/url]

Author:  el_geto [ Tue Feb 22, 2011 9:30 am ]
Post subject:  Re: Mac Audit

Hey everyone,
I just wanted to share my latest piece of code on the Mac Audit for OA. There isn't a lot of progress but I did a lot of cleaning and formatting and added most of the fields on System, Hardware. There are plenty of fields that still need to be completed, specially when is not on System Profiler.
If anyone would like to contribute and fill in more information that would be great.

Keep in mind that while this is aimed towards OAv1, I think that once we identify how to extract most of the information from OSX needed for a v1 audit, we could write a script for v2 as well, the XML output is heck of a lot easier to do.

Also, if anyone has any experience with online repositories and version control I think it would be a huge help.

Attachments:
File comment: Download all other files from this thread. Compile with XCode and Run.
mac_audit.m.zip [9 KiB]
Downloaded 502 times

Author:  emb3dd3d [ Wed Jun 29, 2011 9:07 am ]
Post subject:  Re: Mac Audit

Greetings everyone.. I know this probably wont work on all versions of macs but I have been configuring a reposado server (SUS for mac , offered up by Disney) on a Centos Box and found that you can get a really good hardware platform blast if you use the command line..

systemprofiler -detailLevel basic or full, if you wanted to go that far. I used the following url below

[url]http://ss64.com/osx/system_profiler.html[/url]

i am too lazy to try and convert it to a format that open-audit needs but the fleet-of-foot and time could get it done pretty easily..

Cheers.

emb3dd3d

Author:  emb3dd3d [ Thu Jun 30, 2011 3:53 am ]
Post subject:  Re: Mac Audit

I am currently using the script and it collects Ok info.. but I have a question? Why not use the built in command line tool in OSX to assist?

system_profiler -detailLevel {basic|full} . This spits out a lot of crap that could be useful in
Auditing OSX devices. I would try to write something to dump it in the format required for openaudit.. but alas, I am lazy and a little overwhelmed with another project atm. Check this out
and let's hear your thoughts.

here is the link i got the command from. [url]http://ss64.com/osx/system_profiler.html[/url]

Author:  emb3dd3d [ Wed Aug 10, 2011 6:04 am ]
Post subject:  Re: Mac Audit

nevermind.. I just found the source code for the mac_audit and saw that you are using the system_profiler command.. It appears to just be a formatting issue..

Author:  nithi123 [ Thu Mar 01, 2012 12:39 am ]
Post subject:  Re: Mac Audit

When i run the open_mac_audit.command am getting this error please help me

/Volumes/SoftwareDetails/published-open_mac_01audit/open_mac_audit.command ; exit;
IMAC004:~ root# /Volumes/SoftwareDetails/published-open_mac_01audit/open_mac_audit.command ; exit;
/Volumes/SoftwareDetails/published-open_mac_01audit/open_mac_audit.command: line'27: syntax error near unexpected token `do
/Volumes/SoftwareDetails/published-open_mac_01audit/open_mac_audit.command: line'27: ` for server in $(grep -v "^#" servers.cfg); do
logout

Author:  jpa [ Thu Mar 01, 2012 10:59 am ]
Post subject:  Re: Mac Audit

The Mac audit stuff is pretty rough and best left for experienced Mac users who can deal with XCode.

Having said that what's the content of your servers.cfg file look like?

Author:  nithi123 [ Thu Mar 01, 2012 11:00 pm ]
Post subject:  Re: Mac Audit

Hi,

Yes i have complied with xcode and get the Mac.txt file also. But when i run the automated script to upload to the server am getting those error.i have upload the Mac.txt manually to the server its working fine using this command

#!/bin/sh
./mac_audit
curl --data-urlencode add@mac.txt "http://dell025.lsd.com/openaudit/admin_pc_add_2.php"

and updating the output. But when i run the automated script only am getting this error. Here with i have attached my all files please help me.

Attachments:
Mac.zip [15.04 KiB]
Downloaded 365 times

Author:  jpa [ Fri Mar 02, 2012 2:32 am ]
Post subject:  Re: Mac Audit

OK. This may sound stupid but did you edit the servers.cfg file in the ~/Library/open_mac_audit directory or somewhere else?

Author:  nithi123 [ Fri Mar 02, 2012 11:59 pm ]
Post subject:  Re: Mac Audit

I have checked and the link i provided for the server is correct. when i do that manually its working.

Author:  jpa [ Sat Mar 03, 2012 2:12 am ]
Post subject:  Re: Mac Audit

Sorry, I wasn't specific enough about my suspicions.

The version of the mac audit that you're using expects to be installed into "~/Library/open_mac_audit" by the one_time_DOUBLE_CLICK_TO_install_open_mac_audit.command script. When you call the open_mac_audit.command it is trying to use the servers.cfg file that is located in "~/Library/open_mac_audit" and if you haven't edited that file you won't have any server to post to.

And now that I've reread your original error messages I suspect I might be right here. The error messages say you're running the open_mac_audit.command file in "/Volumes/SoftwareDetails/published-open_mac_01audit" and not in "~/Library/open_mac_audit".

Author:  nithi123 [ Sat Mar 10, 2012 1:13 am ]
Post subject:  Re: Mac Audit

[quote="genloz"]Hi Everyone,

I thought you might be interested in an objective C script that runs on mac os x. It's an xcode project so you'll need to download xcode to compile it on your platform but after that it should run on similar platforms without issue...

There are still a few key things missing - mostly hardware and networking items.
But it's a good start for the basics:
system name, chassis, os, uuid, ip, subnet, processor, memory, software names and versions, ip routes, users & groups...

This script produces a file called mac.txt which I upload with a little bash script to our server:

#!/bin/sh
./mac_audit
curl --data-urlencode add@mac.txt "http://ourhost/openaudit/admin_pc_add_2.php"

You may need to upgrade curl to use '--data-urlencode'...

Thanks!

Hi ,

I have followed the above mentioned method for my mac systems. I can able to compile using xcode and run it successfully from Mac OS X 10.6 and 10.5. But my problem is i cant compile for Mac OS X 10.4.11 which i have in 40 systems. Can any one guide me to do this for Mac OS X 10.4.11. I have attached the files also, can anyone helpme.

Attachments:
mac_audit_.zip [25.67 KiB]
Downloaded 365 times

Author:  jpa [ Sat Mar 10, 2012 2:06 am ]
Post subject:  Re: Mac Audit

I don't have Macs so keep that in mind.

You say you can't compile but you don't say why. No proper XCode version, errors, what? From what I've seen for 10.4 you need XCode 2.5 available in the Downloads->Developer Tools section of connect.apple.com.

Page 3 of 4 All times are UTC + 10 hours
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/