Changeset 286:b16158030def for uwsgi.c
Legend:
- Unmodified
- Added
- Removed
-
uwsgi.c
r285 r286 597 597 {"limit-as", required_argument, 0, LONG_ARGS_LIMIT_AS}, 598 598 {"udp", required_argument, 0, LONG_ARGS_UDP}, 599 {"snmp", no_argument, &uwsgi.snmp, 1},599 {"snmp", optional_argument, 0, LONG_ARGS_SNMP}, 600 600 {"check-interval", required_argument, 0, LONG_ARGS_CHECK_INTERVAL}, 601 601 {"erlang", required_argument, 0, LONG_ARGS_ERLANG}, … … 1167 1167 #endif 1168 1168 1169 #ifdef UWSGI_SNMP 1170 if (uwsgi.snmp) { 1171 snmp_init(); 1172 } 1173 #endif 1169 1174 1170 1175 … … 1317 1322 } 1318 1323 } 1324 #ifdef UWSGI_SNMP 1325 if (uwsgi.snmp) { 1326 if (uwsgi.snmp_community) { 1327 if (strlen(uwsgi.snmp_community) > 72) { 1328 fprintf(stderr, "*** warning the supplied SNMP community string will be truncated to 72 chars ***\n"); 1329 memcpy(uwsgi.shared->snmp_community, uwsgi.snmp_community, 72); 1330 } 1331 else { 1332 strcpy(uwsgi.shared->snmp_community, uwsgi.snmp_community); 1333 } 1334 } 1335 fprintf(stderr, "filling SNMP table..."); 1336 1337 uwsgi.shared->snmp_gvalue[0].type = SNMP_COUNTER64; 1338 uwsgi.shared->snmp_gvalue[0].val = &uwsgi.workers[0].requests; 1339 1340 fprintf(stderr, "done\n"); 1341 1342 } 1343 #endif 1319 1344 for (;;) { 1320 1345 if (ready_to_die >= uwsgi.numproc && uwsgi.to_hell) { … … 2510 2535 fprintf(stdout, "uWSGI %s\n", UWSGI_VERSION); 2511 2536 exit(0); 2537 case LONG_ARGS_SNMP: 2538 uwsgi.snmp = 1; 2539 if (optarg) { 2540 uwsgi.snmp_community = optarg; 2541 } 2542 break; 2512 2543 case LONG_ARGS_PIDFILE: 2513 2544 uwsgi.pidfile = optarg;
