5 years ago
Configsources search
Hello,
Is there a way to search configsources from and external device (another server).
Is there a way to export configsources?
We export pretty much everything regularly via the API and check into a git repo. This allows us to track changes (always fun to find LM devs testing module changes :)/emoticons/smile@2x.png 2x" title=":)" width="20"> ) and more importantly, allows us to grep for things in modules. Among other things, this simplifies finding code examples for starting points on new modules. Our export/backup module does have per endpoint filters since we have found a number of fields that are ephemeral (e.g., timestamps) and must be suppressed to avoid checkin thrashing. Our current export list includes the following. There are a few other features in this, like grouping by client using a client property, saving items one per file and special formatting options to allow the results to be accessible (default output for Groovy code is one long line, making diffs painful).
I could be convinced to share this one, but if you just need one thing like configsources, a specific API script for that may be easier.
Regards,
Mark
my %BACKUPLIST = (
"/setting/alert/chains" => { file => "escalation-chains",
filter => \&filter_escalation_chains,
},
"/setting/alert/rules" => { file => "alert-rules",
filter => \&filter_alert_rules,
},
"/setting/alert/dependencyrules" => { file => "alert-dependencyrules",
# filter => \&filter_alert_dependencyrules,
},
"/setting/admins" => { file => "users",
filter => \&filter_users,
},
"/setting/admin/groups" => { file => "user-groups", },
"/setting/datasources" => { file => "datasources",
## metadata => "/setting/registry/metadata/datasource", # no way to get this info currently
saveoptions => { mode => "oneperfile", format => "dumper" },
},
"/setting/batchjobs" => { file => "jobmonitors", },
"/setting/eventsources" => { file => "eventsources",
saveoptions => { mode => "oneperfile", },
},
"/setting/configsources" => { file => "configsources",
saveoptions => { mode => "oneperfile", format => "dumper" },
},
"/setting/propertyrules" => { file => "propertysources",
saveoptions => { mode => "oneperfile", format => "dumper" },
},
"/setting/topologysources" => { file => "topologysources",
saveoptions => { mode => "oneperfile", format => "dumper" },
},
"/setting/functions" => { file => "appliesto-functions", },
"/setting/oids" => { file => "sysoid-maps", },
"/setting/roles" => { file => "roles", },
"/setting/role/groups" => { file => "role-groups", },
"/setting/recipientgroups" => { file => "recipient-groups", },
"/setting/integrations" => { file => "integrations", },
"/setting/netscans/groups" => { file => "netscan-groups", },
"backup_netscan_policies" => { file => "netscan-policies",
backup => \&backup_netscan_policies,
filter => \&filter_netscan_policies,
},
"/setting/collectors" => { file => "collectors",
filter => \&filter_collectors,
},
"/dashboard/dashboards" => { file => "dashboards", },
"/dashboard/widgets" => { file => "widgets", },
"/dashboard/groups" => { file => "dashboard-groups", },
"/device/devices" => { file => "devices",
groupby => $CLIENTPROP,
filter => \&filter_devices,
},
"/device/groups" => { file => "device-groups",
backup => \&backup_device_groups,
groupby => $CLIENTPROP,
filter => \&filter_device_groups,
},
"/service/services" => { file => "services",
groupby => $CLIENTPROP,
filter => \&filter_services,
},
"/service/groups" => { file => "service-groups",
groupby => $CLIENTPROP,
filter => \&filter_service_groups,
},
"/report/reports" => { file => "reports",
filter => \&filter_reports,
saveoptions => { mode => "oneperfile", nameformat => '%name%.%groupId%', },
},
"/report/groups" => { file => "reports-groups", },
);