Hi Guys,
Huge welldone and thanks to the open-audit team, has made me life so much easier.
The only problem I seem to have is below. When I run the osx script as root manually it works fine. When I add it to cron to run weekly, I get the following errors
Cron Daemon
root@rr0152.local1:50 PM (56 minutes ago)
to macadmin
System Info
/var/root/audit_osx.sh: line 27: system_profiler: command not found
/var/root/audit_osx.sh: line 28: networksetup: command not found
/var/root/audit_osx.sh: line 33: system_profiler: command not found
/var/root/audit_osx.sh: line 34: system_profiler: command not found
/var/root/audit_osx.sh: line 40: system_profiler: command not found
expr: syntax error
/var/root/audit_osx.sh: line 42: sysctl: command not found
Network Cards Info
/var/root/audit_osx.sh: line 121: system_profiler: command not found
/var/root/audit_osx.sh: line 138: system_profiler: command not found
Processor Info
/var/root/audit_osx.sh: line 145: sysctl: command not found
/var/root/audit_osx.sh: line 147: sysctl: command not found
sudo: system_profiler: command not found
(standard_in) 1: parse error
Memory Info
/var/root/audit_osx.sh: line 203: system_profiler: command not found
Software Info
/var/root/audit_osx.sh: line 260: system_profiler: command not found
Submitting results to server
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
100 1131 0 0 100 1131 0 401 0:00:02 0:00:02 --:--:-- 400
100 1803 100 672 100 1131 200 338 0:00:03 0:00:03 --:--:-- 338
100 1803 100 672 100 1131 200 338 0:00:03 0:00:03 --:--:-- 338
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<head>
<title>Open-AudIT</title>
</head>
<body>
<a href='http://open-audit.internal.*.com/index.php/system'>Back to input page</a><br />
<a href='http://open-audit.internal.*.com/index.php'>Front Page</a><br />
SystemID (updated): <a href='http://open-audit.internal.*.com/index.php/main/system_display/29'>29</a>.<br />
<br />Time: 0.9408 seconds.</body>
</html>cat: illegal option -- 2
usage: cat [-benstuv] [file ...]
rm: illegal option -- 2
usage: rm [-f | -i] [-dPRrvW] file ...
unlink file
script is located here /var/root/audit_osx.sh with following file premissions
rwxr-x--- 1 root staff 11K 2 Apr 11:47 audit_osx.sh
I can run the script by doing /var/root/audit_osx.sh but fails if it's in a crontab
RR0152:~ root# crontab -l
MAILTO="macadmin@*.com"
50 13 * * * /var/root/audit_osx.sh
machine is a mac mini running 10.9 aka mavericks. The audit is showing up as running under the device in the web interface.
59 - audit 2014-04-07 14:49:06 192.168.10.127 2014-04-07 14:48:27
I have also tried this on couple of other machines and get the same error.