11-14-2016 12:08 PM
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
11-15-2016 10:35 AM
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.
11-15-2016 11:59 AM - edited 11-15-2016 11:59 AM
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”
Now you have a list of mandatory Users which must be present on a device and _no_ other users are allowed:
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.
11-16-2016 02:05 AM
With those requirements, it sounds like it would be easier to do in Perl rather than CCS. Must it be in CCS?
11-16-2016 06:06 AM
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.
11-16-2016 10:27 AM
I'm curious what platform/OS you're using that has a running-config but doesn't include any local usernames in its display.
04-26-2017 09:53 PM
You can do it with XML Rule Editor