Highlighted
Trusted Contributor.
Trusted Contributor.
343 views

UCMDB hostConnectionByShell - How to add prefix shell before each command

Jump to solution

I'm running a HostConnectionByShell in SSH on a Netscaler. It's seem to be a FreeBSD behind, but all the command need to be prefixed with "shell". For example, "uname -a" doesn't work, but "shell uname -a" works. Someone had the same case and found a way to prefix all command easily in a script? I though i could play with my ssh crendential and the "Privileged Mode Properties" to force a prefix all the time, but it didn't work in my tests or i didn't find the wat to use it.

Thanks

0 Likes
1 Solution

Accepted Solutions
Highlighted
Trusted Contributor.
Trusted Contributor.

Re: UCMDB hostConnectionByShell - How to add prefix shell before each command

Jump to solution

Ok i found a way, in shellutils.py, i created a class like the "class CiscoIOSShell(Shell)" for my Netscaler. In it you can create a _execute function that will be use instead of the default one. Then i can add my prefix and call the default one with it.

That way all my command get the prefix i want. There's few place where out-of-the-box code use "client" instead of "shell" to send a command, i fixe those few place by making sure it use "shell" so it can herit from a specific _execute.

View solution in original post

0 Likes
2 Replies
Highlighted
Trusted Contributor.
Trusted Contributor.

Re: UCMDB hostConnectionByShell - How to add prefix shell before each command

Jump to solution

Ok i found a way, in shellutils.py, i created a class like the "class CiscoIOSShell(Shell)" for my Netscaler. In it you can create a _execute function that will be use instead of the default one. Then i can add my prefix and call the default one with it.

That way all my command get the prefix i want. There's few place where out-of-the-box code use "client" instead of "shell" to send a command, i fixe those few place by making sure it use "shell" so it can herit from a specific _execute.

View solution in original post

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Re: UCMDB hostConnectionByShell - How to add prefix shell before each command

Jump to solution

Hi,

I was looking for this type of thing from last few days.

i have requiremnet where i need to put the kernel version as an attribute in the properties i tried to find from where i can look for this. Could you please help me in this

Regards

Ayush 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.