process the command line arguments in order to decide in which mode the program has to be executed

call the backend init callback

call the backend collect callback a first time

Then, when in pass mode, the corresponding SNMP command is executed, its result is printed on the output filehandle, and run() returns.

When in pass_persist mode, run() enters a loop, reading Net-SNMP queries on its input filehandle, processing them, and printing result on its output filehandle. The backend collect callback is called every refresh seconds. If no query is read from the input after idle_count cycles, run() returns.