diff --git a/config/plugin-commands-hpux.json b/config/plugin-commands-hp-ux.json similarity index 91% rename from config/plugin-commands-hpux.json rename to config/plugin-commands-hp-ux.json index 84859a1..1588b89 100644 --- a/config/plugin-commands-hpux.json +++ b/config/plugin-commands-hp-ux.json @@ -1,20 +1,17 @@ { "os_settings": { - "disksCommand": "", - "disksRegex": "", + "disksCommand": "df -l", + "disksRegex": "\\/\\S*\\s+\\(([^\\)]+)\\).*", "interfacesCommand": "/etc/lanscan", "interfacesRegex": "\\S+\\s+0x[0-9A-Fa-f]+\\s+\\d+\\s+\\S+\\s+\\w+(\\d+).*", "pageSizeCommand": "/bin/getconf PAGESIZE" }, "commands": [{ "eventType": "Disk", - "command": "/bin/bdf -l -i", + "command": "/bin/bdf -i MEMBER_PLACEHOLDER", "mappings": [{ - "expression": "(\\S+)\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)%\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)%\\s+(.*)", + "expression": "[^\\d]*(\\d+)\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)%\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)%\\s+(.*)", "metrics": [{ - "name": "DISK_NAME" - }, - { "name": "Total", "type": "NORMAL" }, @@ -181,9 +178,9 @@ }, { "eventType": "Stats", - "command": "swapinfo", + "command": "/usr/sbin/swapinfo", "mappings": [{ - "expression": ".*(\\w+)\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)%.*", + "expression": "(\\w+)\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)%.*", "metrics": [{ "name": "METRIC_INSTANCE" }, @@ -210,7 +207,7 @@ "eventType": "Stats", "command": "top -d1 -h -n1", "mappings": [{ - "expression": ".*Load averages:\\s+([0-9\\.]+),\\s+([0-9\\.]+),\\s+([0-9\\.]+)", + "expression": "Load averages:\\s+([0-9\\.]+),\\s+([0-9\\.]+),\\s+([0-9\\.]+).*", "metrics": [{ "name": "LoadAverage.1 Minute", "type": "NORMAL" @@ -226,7 +223,7 @@ ] }, { - "expression": ".*(\\d+)\\s+processes:\\s+(\\d+)\\s+sleeping,\\s+(\\d+),\\s+running", + "expression": "(\\d+)\\s+processes:\\s+(\\d+)\\s+sleeping,\\s+(\\d+)\\s+running.*", "metrics": [{ "name": "Processes.Total", "type": "NORMAL" @@ -242,7 +239,7 @@ ] }, { - "expression": ".*(\\d+\\.\\d+)\\s+(\\d+\\.\\d+)%\\s+(\\d+\\.\\d+)%\\s+(\\d+\\.\\d+)%\\s+(\\d+\\.\\d+)%\\s+(\\d+\\.\\d+)%\\s+(\\d+\\.\\d+)%\\s+(\\d+\\.\\d+)%\\s+(\\d+\\.\\d+)%", + "expression": "\\s*([\\d\\.]+)\\s+([\\d\\.]+)%\\s+([\\d\\.]+)%\\s+([\\d\\.]+)%\\s+([\\d\\.]+)%\\s+([\\d\\.]+)%\\s+([\\d\\.]+)%\\s+([\\d\\.]+)%\\s+([\\d\\.]+)%.*", "metrics": [{ "name": "CPU.Load", "type": "NORMAL" diff --git a/pluginctl.sh b/pluginctl.sh index 400463f..35fd241 100755 --- a/pluginctl.sh +++ b/pluginctl.sh @@ -237,7 +237,7 @@ install_dashboards() { installer_url=$(get_variable ${pluginJsonLocation} installer_url ${defaultInstallerURL}) force_deploy=$(get_variable ${pluginJsonLocation} force_deploy ${defaultForceDeploy}) - if [ "$1" == "force_deploy" ]; then + if [ "$1" = "force_deploy" ]; then force_deploy=true fi @@ -251,7 +251,7 @@ install_dashboards() { echo "Dashboards: Skipping installation." else echo "Dashboards: Installing dashboards for $PLUGIN_NAME." - if [ ${force_deploy} == "true" ]; then + if [ ${force_deploy} = "true" ]; then echo "Dashboards: Force-deploy is enabled." fi if command -v curl 2>&1 >/dev/null; then