mirror of
https://github.com/munin-monitoring/contrib.git
synced 2024-09-10 10:42:43 +02:00
munin-plugins-busybox: provide supported plugins via listplugins
This commit is contained in:
parent
50b2baaf69
commit
20f9c7fc37
1 changed files with 19 additions and 1 deletions
|
@ -15,6 +15,20 @@ int processes(int argc, char **argv);
|
||||||
int swap(int argc, char **argv);
|
int swap(int argc, char **argv);
|
||||||
int uptime(int argc, char **argv);
|
int uptime(int argc, char **argv);
|
||||||
|
|
||||||
|
int busybox(int argc, char **argv) {
|
||||||
|
if(argc < 2) {
|
||||||
|
fprintf(stderr, "missing parameter\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if(0 != strcmp(argv[1], "listplugins")) {
|
||||||
|
fprintf(stderr, "unknown parameter\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
puts("cpu\nentropy\nforks\nfw_packets\ninterrupts\nload\n"
|
||||||
|
"open_files\nopen_inodes\nprocesses\nswap\nuptime");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
char *progname;
|
char *progname;
|
||||||
progname = basename(argv[0]);
|
progname = basename(argv[0]);
|
||||||
|
@ -43,6 +57,10 @@ int main(int argc, char **argv) {
|
||||||
if(!strcmp(progname+1, "oad"))
|
if(!strcmp(progname+1, "oad"))
|
||||||
return load(argc, argv);
|
return load(argc, argv);
|
||||||
break;
|
break;
|
||||||
|
case 'm':
|
||||||
|
if(!strcmp(progname+1, "unin-plugins-busybox"))
|
||||||
|
return busybox(argc, argv);
|
||||||
|
break;
|
||||||
case 'o':
|
case 'o':
|
||||||
if(!strcmp(progname+1, "pen_files"))
|
if(!strcmp(progname+1, "pen_files"))
|
||||||
return open_files(argc, argv);
|
return open_files(argc, argv);
|
||||||
|
@ -62,6 +80,6 @@ int main(int argc, char **argv) {
|
||||||
return uptime(argc, argv);
|
return uptime(argc, argv);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
fprintf(stderr, "function not specified\n");
|
fprintf(stderr, "unknown basename\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue