mirror of
				https://github.com/limosek/zaf.git
				synced 2025-10-31 17:47:37 +01:00 
			
		
		
		
	Added basic items
This commit is contained in:
		
							
								
								
									
										12
									
								
								control
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								control
									
									
									
									
									
								
							| @@ -12,12 +12,22 @@ Maintainer: Lukas Macura <lukas@macura.cz> | ||||
| Item: version | ||||
|  Returns version of zaf installed. | ||||
|  | ||||
| Item-cmd-version: {ZAFFUNC} zaf_list_plugins | ||||
| Item-cmd-version: {ZAFFUNC} zaf_version | ||||
|  | ||||
| Item: plugins | ||||
|  Returns installed plugins | ||||
|  | ||||
| Item-cmd-plugins: {ZAFLOCK} zaf list | ||||
|  | ||||
| Item: discovery.plugins | ||||
|  Returns installed plugins in form suitable for zabbix discovery | ||||
|  | ||||
| Item-cmd-discovery.plugins: {ZAFFUNC} zaf_discovery_plugins | ||||
|  | ||||
| Item: plugin_version[*] | ||||
|  Returns maintainer of plugin | ||||
|  | ||||
| Item-cmd-plugin_version[*]: {ZAFFUNC} zaf_plugin_version $1 | ||||
|  | ||||
| Binary-Depends: echo zaf | ||||
|  | ||||
|   | ||||
| @@ -84,6 +84,10 @@ zaf_discovery(){ | ||||
|  | ||||
| ############################################ Zaf internal routines | ||||
|  | ||||
| zaf_version() { | ||||
| 	echo master | ||||
| } | ||||
|  | ||||
| # Restart zabbix agent | ||||
| zaf_restart_agent() { | ||||
| 	${ZAF_AGENT_RESTART} | ||||
| @@ -271,6 +275,24 @@ zaf_show_plugin() { | ||||
| 	fi | ||||
| } | ||||
|  | ||||
| zaf_discovery_plugins() { | ||||
| 	zaf_list_plugins | zaf_discovery '{#PLUGIN}' | ||||
| } | ||||
|  | ||||
| zaf_plugin_version() { | ||||
| 	if [ -z "$1" ]; then | ||||
| 		echo "Missing plugin name"; | ||||
| 		exit 1 | ||||
| 	fi | ||||
| 	plugindir="${ZAF_PLUGINS_DIR}/$1" | ||||
| 	cfile="$plugindir/control" | ||||
| 	if [ -d "$plugindir" ] ; then | ||||
| 		zaf_ctrl_get_option "$cfile" Version | ||||
| 	else | ||||
| 		echo "Plugin $1 not installed"  | ||||
| 	fi | ||||
| } | ||||
|  | ||||
| zaf_list_plugin_items() { | ||||
| 	if [ -z "$1" ]; then | ||||
| 		echo "Missing plugin name"; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Lukas Macura
					Lukas Macura