Juniper Scripting

razarrazar Member Posts: 65 ■■□□□□□□□□
Hi all,

I'm having an issue with a Juniper SRX device where the remote access web page crashes every so often.

I'd like to create a simple script that restarts the web management service at specific intervals eg once a week

Does anyone know the best way that I can do this?

I found this on the Juniper site and think it may work if I adjust the command and times.

set event-options generate-event testEvent time-of-day "10:42:00 +0000"
set event-options policy Policy1 events testEvent
set event-options policy Policy1 then execute-commands commands "show system uptime"

Comments

  • zoidbergzoidberg Member Posts: 365 ■■■■□□□□□□
    I think that should work for you. The command would probably be restart web-management. Careful what intervals you pick. I imagine it would be somewhat annoying to have the server restart while someone is in the middle of using it.

    Check your log files for any indication of issues when the access page crashes. Instead of basing your restart on a time interval, you could create the script to act on an event/log that corresponds with the crash. Then you would only be restarting the process when you actually need to.

    Further, what is causing the crash? Have you worked on identifying the issue with JTAC? Perhaps there is a bug that needs to be fixed, or may have already been fixed. How old is the version of Junos, and are you able to do an upgrade?
  • razarrazar Member Posts: 65 ■■□□□□□□□□
    Yes sorry I took that config from the Juniper document but of course will need to use restart web-management.

    Tried to look thorugh the logs but not sure if I can go back further than the present day, next time it happens I will check the logs to see if there is any obvious message pointing to the crash. I'm not sure if they have JTAC support for this device I'll need to check that.

    They are currently using 12.1X44-D20.3 which I believe is almost a couple years old now so I think an upgrade is probably overdue.

    Thanks
  • zoidbergzoidberg Member Posts: 365 ■■■■□□□□□□
    Ya, X44 is a couple years old now, but at least it's better than the 10.4 deployments I still see :P The good news would be, if this is a bug in the code, surely it would have been identified and fixed in newer versions already.
  • zoidbergzoidberg Member Posts: 365 ■■■■□□□□□□
    Found this in the X44 release notes under known behavior. Not sure if it's what is causing your issue as that's a lot of CLI users, but might be worth checking. Don't have time right now to really do a good bug search unfortunately.

    On SRX210 and SRX240 devices, J-Web crashes if more than nine users log in to the device by using the CLI. The number of users allowed to access the device is limited as follows:
    • For SRX210 devices: four CLI users and three J-Web users
    • For SRX240 devices: six CLI users and five J-Web users
Sign In or Register to comment.