Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
patones1
Contributor
Jump to solution

SmartTask's issue on the R81.20 for "Session Name Lenght" (probably a bug)

Hello,

One SmartTask's  script which used to work on the version R81.10, is not working correctly in the R81.20

It is about the script to run before publishing that will force to write a session name with more than 20 characters :

#!/bin/bash
namelen=`echo $1 | base64 -id | jq -r .session.\"session-name\" | wc -c`
if [[ $namelen -le 20 ]]; then
printf '{"result":"failure","message":"Session name should be at least 20 characters"}\n'
exit 0
else
printf '{"result":"success"}\n'
exit 0
fi

So everything looks right when I write a session name of less than 20 characters. I will use the default session name :

patones1_0-1683478824167.jpeg

 

As usual, the publish operation failed :

patones1_1-1683478824175.jpeg

 

Then, I wrote a session name of more than 20 characters :

Publish+20.JPG

Surprise. I got the same error :

patones1_1-1683478824175.jpeg

 

I tested the same in a R81.10 and the result with a session name of more than 20 characters, was the spected one :

 

details 80.10.JPG

It looks like there is a bug on the R81.20 version

I will try to update the SMS with the last jumbo.
If you have no news, it means that the update did not work.

Have a nice end of the day

Miguel

0 Kudos
2 Solutions

Accepted Solutions
Danny
Champion Champion
Champion

You didn't get what I wanted you to test with my SmartTask examples.

Step1: Please go to this SmartTask and try if it works for you

Step2: If step 1 works as expected, please change "session-description" to "session-name" and adjust the message accordingly. Test again and tell us your result.

View solution in original post

(1)
Danny
Champion Champion
Champion

My unaltered script won't work to verify your demand for session name length verification.


@patones1 wrote:

- I load your script,"Session-Description", in the Script Repository.
- I create the smartTask "Session-Description"
- I publish the smartTask operation.
- I make a change on a policy and I publish with a session name of less than 20 characters

You need to adjust it first as in this example:

test `cat $1|jq -r .session.\"session-name\"|wc -c` -le 20 && echo '{"result":"failure","message":"Session name should be at least 20 characters"}' || echo '{"result":"success"}'

 

View solution in original post

15 Replies
Timothy_Hall
Legend Legend
Legend

Is this for one of the CCSE class lab exercises?

Gateway Performance Optimization R81.20 Course
now available at maxpowerfirewalls.com
0 Kudos
patones1
Contributor

It is the script of the CCSE lab. The good one.
I wonder if they have change it for the R81.20

0 Kudos
the_rock
Legend
Legend

@patones1 

I just tried it in R81.20 lab and it was exact same issue as you described.

Andy

0 Kudos
patones1
Contributor

It looks like is the second part of the script that R81.20 doesn't see :

else
printf '{"result":"success"}\n'

0 Kudos
the_rock
Legend
Legend

I can try this in my R81.20 jumbo 10 lab tomorrow. So you just added new smart task to run this script, thats it?

Andy

0 Kudos
patones1
Contributor

Yes.  It needs to be run twice.
Once with a session name of less than 20 characters. (it will work)
And then with more than 20 characters. (I hope that with the Jumbo10, it will be able to publish).

0 Kudos
Danny
Champion Champion
Champion

That's normal and expected behaviour.
The first publish simply activates your SmartTask, not matter what is configured to perform.
Afterwards the SmartTask is ready for use.
SmartTask examples

0 Kudos
patones1
Contributor

The first publish simply activates your SmartTask ....

This is obvious. My testing is after activating the SmartTask by publishing first.

Then I make changes and publish each change (once with session name of less than 20 characters and the other with more than 20)

Danny
Champion Champion
Champion

You didn't get what I wanted you to test with my SmartTask examples.

Step1: Please go to this SmartTask and try if it works for you

Step2: If step 1 works as expected, please change "session-description" to "session-name" and adjust the message accordingly. Test again and tell us your result.

(1)
the_rock
Legend
Legend

I just verified and works in R81.20...amazing work as always @Danny 🙌🙌

0 Kudos
Danny
Champion Champion
Champion

Thx, please comment this in the SmartTask as well.

0 Kudos
the_rock
Legend
Legend

Just did.

0 Kudos
patones1
Contributor

Hello Champion,

I had tried your script before writing my post. It worked for the session description of less than 20 characters. But when entering a session name with more than 20 characters, the results were same that when using my script

0 Kudos
Danny
Champion Champion
Champion

My unaltered script won't work to verify your demand for session name length verification.


@patones1 wrote:

- I load your script,"Session-Description", in the Script Repository.
- I create the smartTask "Session-Description"
- I publish the smartTask operation.
- I make a change on a policy and I publish with a session name of less than 20 characters

You need to adjust it first as in this example:

test `cat $1|jq -r .session.\"session-name\"|wc -c` -le 20 && echo '{"result":"failure","message":"Session name should be at least 20 characters"}' || echo '{"result":"success"}'

 

patones1
Contributor

Hello Danny,

Yes, you are right. I was testing too fast without modifying the script.

The script works perfectly. When I write a session name of more than 20 characters,  It executes the result:"success" as it should do.

 

Succes_champion_Script.JPG

Thanks a lot and sorry for the misunderstanding.

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events