Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15549

[RESOLVED] SSH output into a DataTable

$
0
0
He guys,
I was wondering if it's possible to pull data from SHH (Renci.SshNet) into a DataTable.
The command that I'm using is:
Code:

]# asterisk -vvvvvrx 'core show channels verbose'
And the output is:
Code:

Channel              Context              Extension        Prio State  Application  Data                      CallerID        Duration Accountcode PeerAccount BridgeID
SIP/4700-00005a1b    ext-intercom        *804701            34 Up      Dial        SIP/4701,5,IA(beep)b(auto 4700            00:01:14                        b9cb3ac4-07bb-4c80-a
SIP/4802-00005a19    from-internal                            1 Up      AppDial      (Outgoing Line)          4802            00:15:57                        bcc87318-a6c6-46a9-9
IAX2/VOIP_CONNECTION macro-dial-one      s                  55 Up      Dial        SIP/4802,,Ttrb(func-apply 2006            00:15:57                        bcc87318-a6c6-46a9-9
SIP/4701-00005a1d    from-internal                            1 Up      AppDial      (Outgoing Line)          4701            00:01:13                        b9cb3ac4-07bb-4c80-a
IAX2/VOIP_CONNECTION macro-dial-one      s                  55 Up      Dial        SIP/4801,,Ttrb(func-apply 2035            00:02:18                        84b2da36-91d7-4f07-a
SIP/4801-00005a1a    from-internal                            1 Up      AppDial      (Outgoing Line)          4801            00:02:18                        84b2da36-91d7-4f07-a
6 active channels
3 active calls
27324 calls processed

It's already 'like' a grid, but is there a way to fill a DataTable with this data (without the last 3 lines)?

P.S.
I need the command above, but I know not everyone has a Asterisk system to play with.
This command would work just great as well (just without the first line)...
Code:

ls -l /
The output is:
Code:

total 44
lrwxrwxrwx    1 root    root        7 May 30  2018 bin -> usr/bin
dr-xr-xr-x.  6 root    root    4096 Oct 31  2020 boot
drwxr-xr-x  20 root    root    3200 Apr 16 08:44 dev
drwxr-xr-x. 110 root    root    8192 Apr 28 09:21 etc
drwxr-xr-x.  3 root    root      21 Apr 11  2018 home
lrwxrwxrwx    1 root    root        7 May 30  2018 lib -> usr/lib
lrwxrwxrwx    1 root    root        9 May 30  2018 lib64 -> usr/lib64
drwxr-xr-x.  2 root    root        6 Apr 11  2018 media
drwxr-xr-x.  2 root    root        6 Apr 11  2018 mnt
drwxr-xr-x.  2 root    root        6 Apr 11  2018 opt
dr-xr-xr-x  155 root    root        0 Apr 16 03:54 proc
dr-xr-x---.  5 root    root    4096 Jun 18 14:05 root
drwxr-xr-x  38 root    root    1100 Jun 16 11:33 run
lrwxrwxrwx    1 root    root        8 May 30  2018 sbin -> usr/sbin
drwxr-xr-x.  2 root    root        6 Apr 11  2018 srv
dr-xr-xr-x  13 root    root        0 Apr 16 03:54 sys
drwxr-xr-x.  7 asterisk asterisk 8192 Oct 22  2020 tftpboot
drwxrwxrwt.  11 root    root    4096 Jun 23 13:19 tmp
drwxr-xr-x    2 root    root        6 Apr 23 10:15 uploads
drwxr-xr-x.  13 root    root    4096 May 30  2018 usr
drwxr-xr-x.  22 root    root    4096 May 30  2018 var

Thanks for the help

Viewing all articles
Browse latest Browse all 15549

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>