Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

torch not working #58

Closed
marsalans opened this issue Nov 16, 2021 · 8 comments
Closed

torch not working #58

marsalans opened this issue Nov 16, 2021 · 8 comments

Comments

@marsalans
Copy link

this is my code and its not working.

    $API->write('/tool/torch',false);
    //$API->write("=interface=vlan3212");
    $API->write("=interface=".$rb_interface);
    $API->write("=src-address=".$rb_ip);
    $ARRAY= $API->read(false);
    print_r($ARRAY);

output:

Connection attempt #1 to 10.0.1.1:5891... <<< [6] /login <<< [13] =name=username_api<<< [26] =password=password_api >>> [5/5] bytes read. >>> [5, 1]!done Connected... <<< [11] /tool/torch <<< [19] =interface=vlan3212 <<< [25] =src-address=10.31.126.21 >>> [5/5] bytes read. >>> [5, 40]!trap >>> [31/31] bytes read. >>> [31, 8]=message=no such command prefix >>> [5/5] bytes read. >>> [5, 1]!done Array ( [0] => !trap [1] => =message=no such command prefix [2] => !done ) Disconnected... Disconnected...

@Chupaka
Copy link

Chupaka commented Nov 16, 2021

$API->write("=interface=".$rb_interface); should be $API->write("=interface=".$rb_interface, false);

@marsalans
Copy link
Author

I also tries that, but it keeps the page loading.

        $API->write('/tool/torch');
        $API->write("=interface=NOC-40G",false);
        $ARRAY= $API->read(false);
        print_r($ARRAY);

@Chupaka
Copy link

Chupaka commented Nov 16, 2021

  1. This should be
        $API->write('/tool/torch', false);
        $API->write("=interface=NOC-40G");

Are you sure you understand the second parameter?

  1. Torch is constantly running command, it produces infinite output. If you need to stop at some point - add duration parameter, like
        $API->write('/tool/torch', false);
        $API->write("=interface=NOC-40G", false);
        $API->write("=duration=1s");

@marsalans
Copy link
Author

marsalans commented Nov 16, 2021 via email

@Chupaka
Copy link

Chupaka commented Nov 16, 2021

Please post exact code and the result.

@marsalans
Copy link
Author

okay my problem is solved now, it was duration issue, 1s is not giving me results

@marsalans
Copy link
Author

thank you for your support.

@Chupaka
Copy link

Chupaka commented Nov 18, 2021

Please close the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants