Multiple "smart hosts?"

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Multiple "smart hosts?"

blue_cowdawg
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On my server at home I am running Nagios to keep track of what my
servers and applications are doing.  I send alerts over SMTP to my pager
when things go wrong.

One of the hosts that I'm monitoring (along with various services) is
the VPS that I use as my mail relay among other things. My server at
home routes ALL outgoing mail through that server.

Of course, the problem with that of course is if the relay is down I am
going to have a hard time sending the page out telling me the relay host
is down.  This has happened and when the relay comes back I get a flood
of pages telling me that the host is down followed by the "all clear."

Is there a way to specify multiple smart hosts in postfix? Better yet,
and I probably have the answer for this already, is there a way to "hard
code" pages to go directly to the paging provider's SMTP server?

- --

Peter L. Berghold     http://www.berghold.net   [hidden email]
Unix Professional     Dog Agility Fan   Crazed Cook
"Those who fail to learn from history are condemned to repeat it."

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIqZ3FUM9/01RIhaARAjh/AKDGJTXPkWTlCntPtEDoFM9uFOY2WwCgp1tH
7y2fcWQcSaggpG9zMGNQozQ=
=PNSd
-----END PGP SIGNATURE-----
Reply | Threaded
Open this post in threaded view
|

Re: Multiple "smart hosts?"

Noel Jones-2
Peter L. Berghold wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
> On my server at home I am running Nagios to keep track of what my
> servers and applications are doing.  I send alerts over SMTP to my pager
> when things go wrong.
>
> One of the hosts that I'm monitoring (along with various services) is
> the VPS that I use as my mail relay among other things. My server at
> home routes ALL outgoing mail through that server.
>
> Of course, the problem with that of course is if the relay is down I am
> going to have a hard time sending the page out telling me the relay host
> is down.  This has happened and when the relay comes back I get a flood
> of pages telling me that the host is down followed by the "all clear."
>
> Is there a way to specify multiple smart hosts in postfix?

You can use smtp_fallback_relay to specify where mail should
go if the relayhost is down.
http://www.postfix.org/postconf.5.html#smtp_fallback_relay

Or you can use a local DNS entry that lists MX records showing
how you want mail routed.

Both the above affect all mail.

> Better yet,
> and I probably have the answer for this already, is there a way to "hard
> code" pages to go directly to the paging provider's SMTP server?

You can use a transport_maps entry to specify where mail to a
specific domain or user should be delivered.

# transport map entry:
[hidden email]  relay:[ip.of.pager.smtp]

http://www.postfix.org/transport.5.html


--
Noel Jones
Reply | Threaded
Open this post in threaded view
|

Re: Multiple "smart hosts?"

mouss-2
Noel Jones wrote:

> Peter L. Berghold wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>>
>> On my server at home I am running Nagios to keep track of what my
>> servers and applications are doing.  I send alerts over SMTP to my pager
>> when things go wrong.
>>
>> One of the hosts that I'm monitoring (along with various services) is
>> the VPS that I use as my mail relay among other things. My server at
>> home routes ALL outgoing mail through that server.
>>
>> Of course, the problem with that of course is if the relay is down I am
>> going to have a hard time sending the page out telling me the relay host
>> is down.  This has happened and when the relay comes back I get a flood
>> of pages telling me that the host is down followed by the "all clear."
>>
>> Is there a way to specify multiple smart hosts in postfix?
>
> You can use smtp_fallback_relay to specify where mail should go if the
> relayhost is down.
> http://www.postfix.org/postconf.5.html#smtp_fallback_relay
>
> Or you can use a local DNS entry that lists MX records showing how you
> want mail routed.
>
> Both the above affect all mail.
>
>> Better yet,

better yet, replace the notification command with a script (perl or
whatever you prefer). you can then implement more controls (when to
notify, whom to notify, ...) as well as
availability/redundancy/failover/...

>> and I probably have the answer for this already, is there a way to "hard
>> code" pages to go directly to the paging provider's SMTP server?
>
> You can use a transport_maps entry to specify where mail to a specific
> domain or user should be delivered.
>
> # transport map entry:
> [hidden email]  relay:[ip.of.pager.smtp]
>
> http://www.postfix.org/transport.5.html
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Multiple "smart hosts?"

blue_cowdawg
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

mouss wrote:

>> # transport map entry:
>> [hidden email]  relay:[ip.of.pager.smtp]
>>


Ohh.. good grief.  I just discovered Comcraps has decided to block port
25.  I didn't notice before because I haven't used port 25 between my
host at home and my VPS in a long time.

Oh well.. so much for that approach.

I've set up the fallback relay and I'll no doubt have an opportunity to
test it before long.   My VPS is acting sick....


- --

Peter L. Berghold     http://www.berghold.net   [hidden email]
Unix Professional     Dog Agility Fan   Crazed Cook
"Those who fail to learn from history are condemned to repeat it."
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIqa0YUM9/01RIhaARAtgCAJ4tTgqu3iCHTVdo1FxNfRHIdEpSxQCfcY0L
JEmz7XJU4+tVnyEzUPWwH4c=
=V/Ly
-----END PGP SIGNATURE-----
Reply | Threaded
Open this post in threaded view
|

Re: Multiple "smart hosts?"

Noel Jones-2
Peter L. Berghold wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> mouss wrote:
>
>>> # transport map entry:
>>> [hidden email]  relay:[ip.of.pager.smtp]
>>>
>
>
> Ohh.. good grief.  I just discovered Comcraps has decided to block port
> 25.  I didn't notice before because I haven't used port 25 between my
> host at home and my VPS in a long time.

See if the pager provider allows SMTP on an alternate port,
such as 587 "submission" or (deprecated but widely used) 465
"smtps".

or maybe you could use the ISP's relay as the target in your
pager transport maps entry.

--
Noel Jones