Home > Bash scripting, Mac administration, Mac OS X > Updated daily server report scripts for 10.7.x and 10.8.x

Updated daily server report scripts for 10.7.x and 10.8.x

I’ve made some updates to the daily server report scripts that I host on my GitHub repo, as I recently tested them on 10.7.x and 10.8.x Server. The existing 10.5.x – 10.6.x script runs fine as-is on 10.7.x Server, but I needed to make a few changes for 10.8.x Server.

I updated the following parts to support 10.8 Server:

PATH

Added /Applications/Server.app/Contents/ServerRoot/usr/sbin to the PATH export, as serveradmin has moved to /Applications/Server.app/Contents/ServerRoot/usr/sbin/serveradmin

Changes to the UNSUCCESSFUL ATTEMPTS TO LOGIN VIA SSH section

In 10.8, /var/log/secure.log‘s functions have been moved to Apple System Log. The script is running syslog -k Time ge -24h | grep 'sshd' to check ASL for SSH activity in the last 24 hours. The SSH activity is exported to /private/tmp/ssh-status.txt, then ssh-status.txt is scraped for SSH errors.

You can access the scripts here on my GitHub repo:

https://github.com/rtrouton/rtrouton_scripts/tree/master/rtrouton_scripts/daily_server_report_script

  1. Dan
    June 30, 2013 at 2:04 am

    Instead of always doing this:

    echo whatever >> $LOG
    echo something else >> $LOG

    You can simply wrap the script with {…..script..} >> $LOG 2>&1

    It makes it much easier to work with, at least in my opinion.

  2. April 3, 2014 at 7:42 am

    Hey Rich,

    Any advice of how to use mail authentication for sending the reports?

    Best regards

    Kostas

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 160 other followers

%d bloggers like this: