New forum rules

The forum get new posts rules.

A new user will be moderate for new post. After five valid posts, the user will be to have right to post without moderation.

If you have some issue to post or to connect, contact us.
See more
See less

Check login telnet or SSH

  • Filter
  • Time
  • Show
Clear All
new posts

  • Check login telnet or SSH

    Hello every one,

    I explain my situation.
    We have are software managing password and we need to check with centreon 1 password user becausse password expire after 2 months.
    so we need to make manipulation for renew this password.
    i don't find plugins for check a login in SSH or Telnet ?

    Sorry if i don't see similar post.
    Thank you in advance for your help.



  • #2

    I find 90% of solution but when is critical, idon't find when make EXIT + print or other for print draft.

    Script create in perl for supervision of Login.


    use Net::Ping;
    use Expect;
    use strict;

    my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNO WN'=>3,'DEPENDENT'=>4);

    my $device = $ARGV[0];
    my $login = $ARGV[1];
    my $password = $ARGV[2];
    my $timeout = 6;

    my $command = Expect->spawn("telnet $device");
    $command->expect($timeout, -re => "Username: ") or exit $ERRORS{'CRITICAL'};
    print $command "$login\r";
    $command->expect($timeout, -re => "Password: ") or exit $ERRORS{'CRITICAL'};
    print $command "$password\r";
    $command->expect($timeout, -re => "#") or exit $ERRORS{'CRITICAL'};
    my $prompt = $command->before().$command->match();
    print "OK - La connexion a fonctionne\n";
    exit $ERRORS{'OK'};


    • #3

      I am not a perl expert but it seems your script is testing the access and return ok if success or critical if login is failed.
      If you want to dig further try this link for remote command using nrpe:
      Or you can use this script which test the login/password: