Setting env variables from misc commands (email from field)

Chris Wilson chris at aidworld.org
Fri Sep 9 17:52:07 CEST 2005


Hi Blake,

> I know nullmailer doesn't ignore the USER variable as I can do it from
> command line.
> 
> Hence why I asked it as a nagios question, because it seems the misc
> commands ignores multiple commands seperated by ; or it just doesn't
> read from ENV variables.

It probably does not support multiple commands nor setting environment
variables directly. But you could try the following command:

	printf "%s" ... | env USER=alerts nullmailer...

Alternatively, you could write a wrapper script for nullmailer that sets
the address for you:

	#!/ bin/sh
	USER=alerts
	nullmailer ...

> It's more of a Nagios question as you should be able to set the from
> field  in nagios.

Why? Nagios doesn't know or care about emails or from fields, it just
runs the command that you tell it to. Personally I like it that way.

Cheers, Chris.
-- 
(aidworld) chris wilson | chief engineer (chris at aidworld.org)



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list