Automation

IMPORTANT MODERATION NOTICE

This community is currently under full moderation, meaning  all posts will be reviewed before appearing in the community. Please expect a brief delay—there is no need to post multiple times. If your post is rejected, you'll receive an email outlining the reason(s). We've implemented full moderation to control spam. Thank you for your patience and participation.



  • 1.  Any System Events Available for SSH Issues?

    Posted 02-03-2016 12:36

    Hi,

     

    When I SSH to a device I get this message:

     

    ssh_exchange_identification: Connection closed by remote host

     

    Is there any Event that's triggered when this error occurs?

     

    Thanks.


    #SSHSSHDEVENTSEVENT-OPTIONS


  • 2.  RE: Any System Events Available for SSH Issues?

    Posted 02-04-2016 01:59

    Hi rais@Darden,

     

     

    You should probably get an "SSHD_LOGIN_FAILED" message, though its not specific to this error .



  • 3.  RE: Any System Events Available for SSH Issues?

    Posted 02-04-2016 07:59

    Is there any event that can be triggered at will e.g. at regular intervals of e.g 48 hours?

     

    Thanks



  • 4.  RE: Any System Events Available for SSH Issues?
    Best Answer

    Posted 02-04-2016 10:46

    You can use "generate_event" to create your own regularly-scheduled named event.  Then, create a policy that "does something" whenevery your event fires.  Like so:

     

    event-options {
        generate-event {
            MY_DAILY_EVENT time-interval 86400;
        }
        policy MY_POLICY {
            events MY_DAILY_EVENT;
            then {
                event-script my-nutty-event-script.slax  {
                    arguments {
                        arg1 hello;
                        arg2 world;
                    }
                }
            }
        }
        event-script {
           file my-nutty-event-script.slax;
        }
    }
    

    You don't *have* to use an event script in the "then" clause.  You can use "execute-commands", "change-configuratino" etc as needed.    

     

    Is that what you're asking ?

    /doug

     



  • 5.  RE: Any System Events Available for SSH Issues?

    Posted 02-04-2016 12:28

    Yes, that's what I was asking.

    Thanks.



  • 6.  RE: Any System Events Available for SSH Issues?

    Posted 02-04-2016 12:41

    Excellent!  Glad to help.

     

    FWIW, you can also check out  an article I wrote about a year or so ago that mentions that technique. ("Approach 1")

    /doug

     

    p.s.

    I know it says "Cordelia"  is author, but it's mine. 😉    If you read all the way to the end, you'll see author attribution