Load probe

This commit is contained in:
Henri DF
2016-04-04 18:39:42 -07:00
parent d96336ccaa
commit 77440750e6
2 changed files with 14 additions and 1 deletions

View File

@@ -6,3 +6,4 @@
#define DIGWATCH_LUA_MAIN "${DIGWATCH_LUA_MAIN}"
#define PROBE_NAME "${PROBE_NAME}"

View File

@@ -292,7 +292,19 @@ int digwatch_init(int argc, char **argv)
rules->load_rules(rules_file);
inspector->set_filter(rules->get_filter());
inspector->open("");
try
{
inspector->open("");
}
catch(sinsp_exception e)
{
if(system("modprobe " PROBE_NAME " > /dev/null 2> /dev/null"))
{
fprintf(stderr, "Unable to load the driver\n");
}
inspector->open("");
}
do_inspect(inspector,
rules,