Learn How We Can Help You Keep Teleworkers Protected During the COVID-19 Crisis

Network Change & Configuration Management

Reply
Highlighted

Mandatory Users not found on a device Issue – Help needed with CCS Script

Expert
Posts: 42
5507     0

Hi folks,

 

I want to create a custom Issue listing all user accounts which are mandatory for a certain device or device group, preferable by the use of a CCS Script.

 

The current configured users are not revealed inside the running config but can be listed by sending a “show user” cli command.

 

My initial idea was to retrieve a list of all mandatory users by using the getListValue() function into an array and remove the all found users from that array.

 

The remaining users in that array are then issued to custom issue –mandatory users not found on device-

 

I hope someone can give me hint how to accomplished this.

 

 

Huge Thanks in advance

Highlighted

Re: Mandatory Users not found on a device Issue – Help needed with CCS Script

Expert
Posts: 127
5508     0

I think you have the basics to what needs to be done.  Seems like it would work.  You would need to loop through each of the array list users and compare against the result of the 'show user'.  If not found then trigger the custom issue.  This should be just a ccs script with an action command, trigger, and issue sections.  The trigger section is where you'd look up the values in the list.

 

I can help more if you need later tonight.

 

 

 

 

Highlighted

Re: Mandatory Users not found on a device Issue – Help needed with CCS Script

[ Edited ]
Expert
Posts: 42
5508     0

Thanks Lon for giving me input on this.

 

Additionally, I want to clarify what I want to achieve and also to extend my needs.

 

Assume the device outputs the following users when sending the cli command “show user”

 

User:

  1. Tom
  2. Mark
  3. Rudolf
  4. Peter

 

Now you have a list of mandatory Users which must be present on a device and _no_ other users are allowed:

 

  1. Tom,
  2. Mark
  3. Jacob

 

 

So, I want to raise two custom issues:

 

-Invalid Users found:

 

You spotted an invalid user (Rudolf) on device…

You spotted an invalid user (Peter) on device…

 

-Mandatory Users not found on device:

 

User (Jacob) has not been found on device listed users but should be. Fix it please.

 

Highlighted

Re: Mandatory Users not found on a device Issue – Help needed with CCS Script

Expert
Posts: 127
5508     0

With those requirements, it sounds like it would be easier to do in Perl rather than CCS.  Must it be in CCS?

Highlighted

Re: Mandatory Users not found on a device Issue – Help needed with CCS Script

Expert
Posts: 42
5508     0

Well, It would be very nice to accomplish this with a CCS Script, but I also see no option due to the missing loop through array function here. So Perl is the right choice for now.

Highlighted

Re: Mandatory Users not found on a device Issue – Help needed with CCS Script

Expert
Posts: 236
5508     0

I'm curious what platform/OS you're using that has a running-config but doesn't include any local usernames in its display.

Highlighted

Re: Mandatory Users not found on a device Issue – Help needed with CCS Script

Expert
Posts: 42
5508     0

Its a Citrix WAN Optimizer

Highlighted

Re: Mandatory Users not found on a device Issue – Help needed with CCS Script

Adviser
Posts: 431
5508     0

You can do it with XML Rule Editor Smiley Happy

Follow me on LinkedIn: https://www.linkedin.com/in/sifbaksh
Twitter: https://twitter.com/sifbaksh

www.sifbaksh.com
Showing results for 
Search instead for 
Do you mean 

Recommended for You