LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Best way schedule tripwire (https://www.linuxquestions.org/questions/linux-software-2/best-way-schedule-tripwire-674211/)

Shwick 10-04-2008 11:12 AM

Best way schedule tripwire
 
Ubuntu 8.04

Does tripwire have a config file that can schedule integrity checks, or do I have to do it from a cron job?

watcher69b 10-05-2008 06:50 AM

I have never useded it myself but usually cron is your best bet.

Shwick 10-05-2008 03:42 PM

I built this off of the tripwire daily cron script. I'm trying to check the number of violations.

There's a problem when $tripResult is instantiated with the tripwire report- it doesn't have any newline characters.

This causes grep to not get the line with the number of violations, it just gets the entire report.



#!/bin/sh -e

tripwire=/usr/sbin/tripwire

[ -x $tripwire ] || exit 0

umask 027

tripResult=$($tripwire --check --quiet)

tripViolations=$(echo $tripResult | grep "Total violations found" | awk '{print $4}')

exit 0

chrism01 10-05-2008 09:04 PM

Sounds odd, but if you're sure about that, why not let it write a tmp file somewhere, then grep the file?

Shwick 10-07-2008 09:35 PM

I could issue tripwire --check twice(bad), I could write the results to a file then read it twice(ok...), but is there some option that will keep redundant white space in the shell variable?


All times are GMT -5. The time now is 02:30 PM.