Results 1 to 1 of 1

Thread: System Log Viewer, Alert Box

  1. #1
    Join Date
    Nov 2012
    Beans
    16

    System Log Viewer, Alert Box

    I am trying to write a shell script (.sh) to search the log files for any occurrences of entries with the tags "attackalert" or "UFW BLOCK". The following is an excerpt of what I have worked out:

    Code:
    #!/bin/bash
    
    tail -f /var/log/messages | grep "attackalert\|UFW BLOCK" | xargs -I {} dialog --ascii-lines --infobox "PortSentry  Alert: The system logs indicate one or more port scans were launched  against this computer since this script was last executed. See [the log]  for details.\n" 7 80
    Some other things of note: This script gets executed with root privileges. It runs as a cron job, every 15 minutes. My goal is, if the grep command returns results, a pop-up on the screen displays the text that I tried to display with "dialog". It seems that dialog only invokes the terminal for a GUI, and if one is not found, it doesn't show anything. Help?
    Last edited by ACagliano; November 23rd, 2012 at 03:40 PM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •