Junos OS

last person joined: yesterday 

Ask questions and share experiences about Junos OS.
  • 1.  boot-script

    Posted 06-17-2009 12:30

    Hey All,

     

    I want to take the pic-slot 1 after a reboot down and back up again.  But I can't find the right event.  The script looks something like this I think:

     

    [edit event-options]
    policy policy1 {
    events e1;
    then {
    execute-commands {
    commands {
    "request chassis pic fpc-slot 0 pic-slot 1 offline";
    "request chassis pic fpc-slot 0 pic-slot 1 online";
    }
    }

    I would be very pleased if someone could give me a hint.

    Thanks in advance



  • 2.  RE: boot-script

    Posted 06-17-2009 16:35

    Would you want to match on chassis-control starting?  That way it would trigger whenever chassisd restarted whether the box rebooted or not.

     

    You can do that with this event:

     

    events SYSTEM;
    attributes-match {
        SYSTEM.message matches ".*chassis-control.*

    }

     

    The problem is that when chassisd first restarts it won't have yet learned about the PIC that you want to bounce.  Did you want some kind of a pause built in?

     



  • 3.  RE: boot-script

    Posted 06-18-2009 00:12

    Hey ccall

     

    Thanks for your reply!

     

    But because I don't have any experience in writing scripts I'm open for suggestions.

    Implementing a pause would be a good sollution for our script to work.

     

     

     

     

     



  • 4.  RE: boot-script

    Posted 06-18-2009 11:43

    You can try the attached script.  It is written to pause for three minutes upon execution and five seconds between the offline and online commands.

     

    To use it, first copy it into the /var/db/scripts/event directory and then enter the following configuration:

     

    event-options {
        policy chassisd {
            events SYSTEM;
            attributes-match {
                SYSTEM.message matches .*chassis-control.*;
            }
            then {
                event-script bounce-pic.slax;
            }
        }
        event-script {
            file bounce-pic.slax;
        }
    }

     

    I'm assuming that you're using JUNOS 9.0 or beyond, if not then let me know as the storage location and configuration is slightly different.



  • 5.  RE: boot-script
    Best Answer

    Posted 06-19-2009 03:17

    Hi ccall,

     

    Thanks for helping me with the script.  I will try this one.

     

    Best regards 


    LA