Junos Automation (Scripting)
Highlighted
Junos Automation (Scripting)

2 host ip addresses active / standby monitoring

‎03-29-2015 10:04 PM

hi,

 

   I would like to perform the ff: scenario using a script which will trigger the secondary server to become active once the primary server is down.

 

  im running on inet.0 routing instance.

  i have 2 untrust and 1 trust security zones.

 

  my user is in 1.1.1.0/24 network...

  my 2 servers is in 2.2.2.0/24 network

         -2.2.2.2 -server1

         -2.2.2.3 -server 2

 

  the current active server is server1 (2.2.2.2). all syslog traffic will go thru this server1. 

 

  i will configure a script that will monitoring the 2.2.2.2 host, once it detects a failure (host network issue), the script will perform a route towards 2.2.2.3 (server2) who will receive the syslog traffic.

 

  im not sure how im going to do it...where all predefined events were more on snmp traps with interface down.

 

   thanks and more power.

 

dwayne

 

4 REPLIES 4
Highlighted
Junos Automation (Scripting)

Re: 2 host ip addresses active / standby monitoring

‎03-29-2015 11:02 PM

hi,

 

Why not sending all the syslog traffic to both servers ? It can be easy configured within junos. Then you do not need to do some "tricks" with scripts 🙂

 

See config below:

 

marcel@lab0> edit configuration system syslog

archive size 2m files 10;
user * {
    any emergency;
}
host 2.2.2.2 {
    authorization info;
    daemon notice;
    ftp any;
    kernel any;
    user any;
    firewall any;
    pfe notice;
    conflict-log any;
    change-log any;
    interactive-commands any;
    explicit-priority;
}
host 2.2.2.2 {
    authorization info;
    daemon notice;
    ftp any;
    kernel any;
    user any;
    firewall any;
    pfe notice;
    conflict-log any;
    change-log any;
    interactive-commands any;
    explicit-priority;
}
file messages {
    any notice;
    authorization info;
}
file interactive-commands {
    interactive-commands error;
}
source-address <ip of your juniper device>;

Marc



-----------------------------------------------------------------
Please Mark My Solution Accepted if it Helped, Kudos are Appreciated Too
-----------------------------------------------------------------
Highlighted
Junos Automation (Scripting)

Re: 2 host ip addresses active / standby monitoring

‎04-16-2015 02:29 AM

Hi Marc,

 

 We made some modifications on the design traffic flow.

 

i need to combine rpm probe monitoring and event script trigger attributes in such a way that;

 

  >  if isp-1 is down, rpm probe will auto route failover to isp-2.

  > deactivate server-1 ip address from using the isp-1 NAT

  > activate server-2 ip address using the isp-2 NAT

  

both conditions should meet...

 

and what another script that will monitor once isp-1 is up...configurations will revert to its previous condition.

 

 

ex:

  ge-0/0/5.0  => 1.1.1.1/24 ==> ISP-1 Zone (Active)

  ge-0/0/6.0 => 2.2.2.2/24 ==> ISP-2  Zone (Standby)

 

  ge-0/0/7.0 => 3.3.3.0/24 ==> trust Zone (users)

 

    server-1 => 3.3.3.10/32 (translated to 1.1.1.10)  ISP-1 

    server-2 => 3.3.3.11/32 (translated to 2.2.2.10)  ISP-2

 

dwayne

Highlighted
Junos Automation (Scripting)

Re: 2 host ip addresses active / standby monitoring

‎04-16-2015 03:54 AM

I'm not sure what you want ot achieve ? Syslog can be send always to multiple destination hosts.

Can you explain a bit more why you want to make it so complex for sending syslog messages ?

 

Marc



-----------------------------------------------------------------
Please Mark My Solution Accepted if it Helped, Kudos are Appreciated Too
-----------------------------------------------------------------
Highlighted
Junos Automation (Scripting)

Re: 2 host ip addresses active / standby monitoring

‎04-16-2015 09:57 AM
Below URL explains how to change configurations based on rpm-probes/events using event-options

http://www.juniper.net/documentation/en_US/junos14.2/topics/topic-map/junos-script-automation-event-...
Thanks,
Suraj
Please Mark My Solution Accepted if it Helped, Kudos are Appreciated too
Feedback