In message <[email protected]>, Risto Vaarandi writes: >Gabriele Giorelli wrote: >> in rules I have: >> action=pipe '$0' /usr/bin/mailx -s '[SEC] An error occurred' [email protected] >> >> how to include the hostname in the subject to read: >> >> action=pipe '$0' /usr/bin/mailx -s '[SEC] An error occurred on jupiter' ab >[email protected] > >try the following: > >action=pipe '$0' /usr/bin/mailx -s "[SEC] An error occurred on `uname >-n`" [email protected]
If on the other hand you want the host name from the event that caused this action, you need to write a pattern matching rule that uses a subpattern. The value of each subpattern is assigned to the special variables $1 for the first subpattern, $2 for the second etc. Assuming that the first subpattern matches the host name you can use: action=pipe '$0' /usr/bin/mailx -s '[SEC] An error occurred on $1' [email protected] There are a number of examples in the man page. -- -- rouilj John Rouillard =========================================================================== My employers don't acknowledge my existence much less my opinions. ------------------------------------------------------------------------------ Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers & brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, & iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian Group, R/GA, & Big Spaceship. http://www.creativitycat.com _______________________________________________ Simple-evcorr-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users
