def get_metadata(plugin): """ Gets metadata for plugin :param plugin: plugin object :return: metadata dict for that plugin """ return risu.generic_get_metadata(plugin)
def get_metadata(plugin): """ Gets metadata for plugin :param plugin: plugin object :return: metadata dict for that plugin """ metadata = risu.generic_get_metadata(plugin=plugin) metadata["backend"] = "nagios" return metadata
def get_metadata(plugin): """ Gets metadata for plugin :param plugin: plugin object :return: metadata dict for that plugin """ description = "" metadata = risu.generic_get_metadata(plugin=plugin) metadata.update({"description": description, "priority": 333}) return metadata
def get_metadata(plugin): """ Gets metadata for plugin :param plugin: plugin object :return: metadata dict for that plugin """ metadata = risu.generic_get_metadata(plugin=plugin) subcategory = os.path.split(plugin["plugin"])[0].replace(pluginsdir, "") category = os.path.normpath(subcategory).split(os.sep)[1] or "" metadata.update({"subcategory": subcategory, "category": category}) return metadata
def get_metadata(plugin): """ Gets meadata for plugin :param plugin: plugin object :return: metadata dict for that plugin """ with open(plugin["plugin"], "r") as stream: try: doc = yaml.safe_load(stream) except: doc = "" try: description = doc[0]["vars"]["metadata"]["description"] except: description = "" metadata = risu.generic_get_metadata(plugin=plugin) metadata.update({"description": description}) return metadata