MonitoringExchange
NagiosForge
NagiosWiki
Nagios Community Platform powered by NETWAYS

HowTos:TipandTricks:DollarCharacterCommand

Search  
From MonEx Wiki
Jump to: navigation, search

check_command with $-Character

You will check a hidden Samba Share (e.g. C$) or a WindowsService with $ in the Servicename.

Example:
hidden samba share

nagios@nagioswiki.org:~/
define service {
  use                  windows-services
  name                 windows share
  service_description  hidden samba share c$
  check_command        check_disk_smb!c$
  register             0
}

Error message:

Invalid Share Name ...\c

Solution:
So that Nagios recognizes the $ character, you must it be masked with a further $ character

nagios@nagioswiki.org:~/
define service {
  use                  windows-services
  name                 windows share
  service_description  hidden samba share c$
  check_command        check_disk_smb!c$$
  register             0
}

The same solution with the $$ is for the Problem with Windows Servicename.