Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 241047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:43:14+00:00 2026-05-11T20:43:14+00:00

In the man page I see the following: -L LOGOPTS Toggle various defaults controlling

  • 0

In the man page I see the following:

-L LOGOPTS        Toggle various defaults controlling logging:
              e:           log to standard error
              o:           log to standard output

This excites me very much because I’m in a situation where it would be
advantageous for me to capture errors from STDOUT rather than from
STDERR.

If I run the command:

snmpget -v1 -ccommString  -Lo 172.16.x.x  .1.2.3.4.5.6.7.8.9

I get back in my terminal

Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: iso.2.3.4.5.6.7.8.9

however if I run the command:

snmpget -v1 -ccommString  -Lo 172.16.x.x .1.2.3.4.5.6.7.8.9 2> foo

I get no response at the terminal but the file foo contains the same
error message that I got above. So I am getting the error message on
STDERR and not on STDOUT as I would expect.

Am I reading the man page wrong here? Additionally I have tried this
on both linux and windows systems and because of the situation I’m in
I would prefer to have the errors emitted on STDOUT rather than STDERR
because I do not want to use the shell to do the work with the usual
2>&1

Any help or suggestions greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T20:43:14+00:00Added an answer on May 11, 2026 at 8:43 pm

    The following c code is part of the source of the snmpget utility (snmpget.c in net-snmp-5.4.2.1\apps).

    fprintf(stderr, "Error in packet\nReason: %s\n",
            snmp_errstring(response->errstat));
    
    if (response->errindex != 0) {
        fprintf(stderr, "Failed object: ");
        for (count = 1, vars = response->variables;
                vars && count != response->errindex;
                vars = vars->next_variable, count++)
            /*EMPTY*/;
        if (vars) {
            fprint_objid(stderr, vars->name, vars->name_length);
    

    As you can see messages are simply written to stderr.

    You can have a custom snmpget utility: Download the source, replace stderr with stdout then recompile.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Today, looking at the man page for open() , I've noticed this function is
The man page says: fgets() return s on success, and NULL on error or
From the recv(2) man page: MSG_WAITALL This flag requests that the operation block until
I'v been googling and reading the man page but I do not see the
git-log man page says: git log [options] [since..until] [[--] path...] since..until Show only commits
The man page of epoll_ctl() says about EPOLLPRI : There is urgent data available
The man page for mlockall on my kernel 3.0 says mlockall() locks all pages
From pthread_join() man page : When a joinable thread terminates, its memory resources (thread
Here is the man page for git show-ref -d . They also have an
According to the man page for pbpaste , -Prefer {txt | rtf | ps}

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.