{
# --------------------------------------------------------------------------
# NOTIFYFLAG - change behavior of upsmon when NOTIFY events occur
#
# By default, upsmon sends walls (global messages to all logged in users)
# and writes to the syslog when things happen.  You can change this.
#
# NOTIFYFLAG <notify type> <flag>[+<flag>][+<flag>] ...
#
# NOTIFYFLAG ONLINE SYSLOG
# NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC
#
# Possible values for the flags:
#
# SYSLOG - Write the message in the syslog 
# WALL   - Write the message to all users on the system
# EXEC   - Execute NOTIFYCMD (see above) with the message
# IGNORE - Don't do anything
#
# If you use IGNORE, don't use any other flags on the same line.
    my %def_action = (
	ONLINE => "SYSLOG",
	ONBATT => "SYSLOG",
	LOWBATT => "SYSLOG",
	FSD => "SYSLOG",
	COMMOK => "SYSLOG",
	COMMBAD => "SYSLOG",
	SHUTDOWN => "SYSLOG+EXEC",
	REPLBATT => "SYSLOG",
	NOCOMM => "SYSLOG",
    );
    foreach my $event (keys %def_action)
    {
	my $flag = ucfirst lc $event;
	$flag .= "Flag";
	my $action = $nut{$flag} || $def_action{$event};
	$OUT .= "NOTIFYFLAG $event $action\n";
    }
}
