Generating E-mail when Solaris security patches are available

I wrote about pca a few weeks back, and absolutely love the capabilities it brings to the table. To keep my servers up date with the latest security patches, I added the following cron job to extract security patches from the pca output, and E-mail them to my account:

0 0 * * * pca -l | awk '$5 ~ /S/ { print $0}'  | mailx -s "Security updates for $HOSTNAME" root

This works pretty well, and I now get E-mailed when security patches are available.

4 thoughts on “Generating E-mail when Solaris security patches are available”

  1. I find this utility great.
    Thanks for the post.

    Only thing I was curious about was have you figured out a way to have it only email if there are security updates?

    When there isn’t this generates a blank email to me.

  2. Hi Chris,

    You can use the following script:

    #!/bin/sh

    SECURITY=`/home/apps/sysadmin/scripts/pca -l | awk ‘$5 ~ /S/ { print $0}’`

    if [ ! -z “${SECURITY}” ]
    then
    echo ${SECURITY} | mailx -s “Security updates for neutron” root
    fi

    – Ryan

  3. Hello,
    I’m try to use pca patch tool and when i run command
    ./pca.sh -d -x –user=username –passwd=passwd –xrefdir=/var/Patches/pca-patches/var/tmp -P /var/Patches/pca-patches/var/patches
    script gave me error:
    cannot parse xref file
    Do you have any idea how to fix this?
    Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *