Created
May 11, 2015 16:59
-
-
Save morgajel/170b6e6e0c17666c38a9 to your computer and use it in GitHub Desktop.
password not showing up in debug log (correct behavior, I think?)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object CheckCommand "check_mssql_health" { | |
import "plugin-check-command" | |
#command = "$USER1$/check_mssql_health --server $host.name$ --username Monitoring --password $mssqlCredential$ --offlineok --mode $ARG1$" | |
command =[ PluginMorgNagPlugDir + "/check_mssql_health"] | |
arguments = { | |
"--server" = "$address$" | |
"--password" = "$mssql_password$" | |
"--username" = "$mssql_username$" | |
"--mode" = "$mssql_mode$" | |
"--name" = "$mssql_name$" | |
"--warning" = "$mssql_warn$" | |
"--critical" = "$mssql_crit$" | |
"--offlineok" = { | |
set_if = "$mssql_offlineok$" | |
} | |
} | |
vars.mssql_username = "Monitoring" | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mssqlCredentials = "somethinggood" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[2015-05-11 12:55:19 -0400] information/ExternalCommandListener: Executing external command: [1431363319] SCHEDULE_FORCED_SVC_CHECK;sqlserver;sqlserver Page locks-timeouts;1431363319 | |
[2015-05-11 12:55:19 -0400] notice/ExternalCommandProcessor: Rescheduling next check for service 'sqlserver Page locks-timeouts' | |
[2015-05-11 12:55:19 -0400] debug/IdoMysqlConnection: Query: INSERT INTO icinga_externalcommands (command_args, command_name, command_type, entry_time, instance_id) VALUES ('sqlserver;sqlserver Page locks-timeouts;1431363319', 'SCHEDULE_FORCED_SVC_CHECK', '54', FROM_UNIXTIME(1431363319), 1) | |
[2015-05-11 12:55:19 -0400] debug/CheckerComponent: Executing check for 'sqlserver!sqlserver Page locks-timeouts' | |
[2015-05-11 12:55:19 -0400] notice/Process: Running command '/opt/morgnagplug/check_mssql_health' '--critical' '30' '--mode' 'locks-timeouts' '--name' 'Page' '--server' '192.168.2.59' '--username' 'Monitoring' '--warning' '20': PID 31284 | |
[2015-05-11 12:55:19 -0400] debug/CheckerComponent: Check finished for object 'sqlserver!sqlserver Page locks-timeouts' | |
[2015-05-11 12:55:19 -0400] notice/Process: PID 31284 ('/opt/morgnagplug/check_mssql_health' '--critical' '30' '--mode' 'locks-timeouts' '--name' 'Page' '--server' '192.168.2.59' '--username' 'Monitoring' '--warning' '20') terminated with exit code 2 | |
[2015-05-11 12:55:19 -0400] debug/DbEvents: add service check history for 'sqlserver!sqlserver Page locks-timeouts' | |
[2015-05-11 12:55:19 -0400] debug/DbObject: Endpoint node: 'det1c7ut001.entregasystems.com' status update for 'sqlserver!sqlserver Page locks-timeouts' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply Service "sqlserver _total locks-timeouts" to Host { | |
import "generic-service" | |
import "trendable" | |
check_command = "check_mssql_health" | |
max_check_attempts = 3 | |
vars.mssql_username="Monitoring" | |
vars.mssql_password="$mssqlCredentials$" | |
#vars.ARG1 = "locks-timeouts --name _Total --warning=20 --critical=30" | |
vars.mssql_name = "_Total" | |
vars.mssql_mode = "locks-timeouts" | |
vars.mssql_warn = "20" | |
vars.mssql_crit = "30" | |
assign where "sqlserver2012" in host.groups | |
} |
Output displayed within icingaweb:
Plugin Output
CRITICAL - cannot connect to 192.168.2.59. Please specify hostname or server, username and password
icinga2 object list --name 'check_mssql_health'
Object 'check_mssql_health' of type 'CheckCommand':
% declared in '/etc/icinga2/conf.d/commands.conf', lines 294:1-294:40
- __name = "check_mssql_health"
- arguments
% = modified in '/etc/icinga2/conf.d/commands.conf', lines 299:9-310:9- --critical = "$mssql_crit$"
- --mode = "$mssql_mode$"
- --name = "$mssql_name$"
- --offlineok
- set_if = "$mssql_offlineok$"
- --password = "$mssql_password$"
- --server = "$address$"
- --username = "$mssql_username$"
- --warning = "$mssql_warn$"
- command = [ "/opt/morgnagplug/check_mssql_health" ]
% = modified in '/etc/icinga2/conf.d/commands.conf', lines 297:5-297:60 - env = null
- execute
% = modified in '/usr/share/icinga2/include/command.conf', lines 35:2-35:22- type = "Function"
- name = "check_mssql_health"
- templates = [ "check_mssql_health", "plugin-check-command" ]
% = modified in '/etc/icinga2/conf.d/commands.conf', lines 294:1-294:40
% = modified in '/usr/share/icinga2/include/command.conf', lines 34:1-34:44 - timeout = 60
- type = "CheckCommand"
- vars = null
- zone = ""
Final solution- Global variables don't need quotes or $;
"--password" = "$mssql_password$"
should be
"--password" = mssqlCredentials
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Running at the command line without and with a password: