Long-time lurker, first-time poster. Please forgive the following atrocity.

Basically, I'm using Net::Appliance::Session to login to a Cisco router, and it's functioning perfectly. The only problem is that I'm getting a ton of output that I can't figure out how to turn off.

I've tried adding $s->set_global_log_at('error'); in hopes that it would turn off all non-error output, but to no avail. Does anyone know how to turn down the output level?

My code, taken from here, followed by a sample of the output I'm seeing:

use strict; use warnings; use Net::Appliance::Session; my $host = 'host'; my $user = 'username'; my $pass = 'password'; my $s = Net::Appliance::Session->new({ personality => 'cisco', transport => 'SSH', host => $host, do_paging => 0 }); try { $s->connect({ username => $user, password => $pass }); $s->begin_privileged({ password => $pass }); print $s->cmd('show clock'); $s->end_privileged; } catch { warn "Failed to execute command: $_"; } finally { $s->close; };

Output:

Net::CLI::Interact::ActionSet { Parents Moo::Object public methods (11) : apply_params, BUILDARGS, clone, current_matc +h, default_continuation, DOES, execute, has_current_match, has_defaul +t_continuation, new, register_callback private methods (6) : _callbacks, _do_exec, _forward_continuation_ +to_match, _has_callbacks, _marshall_responses, _pad_send_with_match internals: { _callbacks [], current_match [ [0] [Pp]assword\s*:\s*$ ], _position -1, _sequence [ [0] Net::CLI::Interact::Action { Parents Moo::Object public methods (12) : BUILDARGS, clone, continuation, +new, no_ors, num_params, params, prompt_hit, response, response_stash +, type, value private methods (0) internals: { no_ors 0, params [], response "", response_stash "", type "send", value " " } }, [1] Net::CLI::Interact::Action { Parents Moo::Object public methods (12) : BUILDARGS, clone, continuation, +new, no_ors, num_params, params, prompt_hit, response, response_stash +, type, value private methods (0) internals: { no_ors 0, params [], prompt_hit var{current_match}[0], response "password: ", response_stash "", type "match", value var{current_match} } } ] } }

In reply to Net::Appliance::Session is sending too much output to the screen by tired_baboon

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.