Icinga/Nagios: Windows monitoring

Another alternative way to monitor Windows machines with NSC-Client, you need only one time access to the Windows-Box and install the client and configure it.

All other monitoring steps can be performed from the monitoring instances like Icinga or Nagios.

Q: What can be monitored? Are there any limits?
A: You can monitor everything you want: memory usage, CPU, RDP-Connections and all Microsoft Exchange stuff. There are no limits you can easily extend the feature with tiny remote batch scripts that will be executed and the output will be evaluated by your monitoring instances.

Download:
Choose the right architecture for your system and download the actual stable NSC-Client.

Installation:
Straightforward installation you know how to use the Next button;) You can let the configuration offers blank!

Configuration:
Edit the configuration file for NSClient++ (C:\Program Files\NSClient++\NSC.ini):

After editing the “C:\Program Files\NSClient++\NSC.ini”-config restart NSClient Service:

Monitoring Instance:

Define Commands:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
define command {
    command_name    check_win
    command_line    /usr/lib/nagios/plugins/check_nt -H $HOSTADDRESS$ -p 12489 -s test -v $ARG1$ $ARG2$
}
 
define command {
    command_name    check_terminal_active
    command_line    /usr/lib/nagios/plugins/check_nt -H $HOSTADDRESS$ -s test -p 12489  -v COUNTER -l "\\Terminal Services\Active Sessions" -w 1 -c 2
}
 
define command {
    command_name    check_terminal_inactive
    command_line    /usr/lib/nagios/plugins/check_nt -H $HOSTADDRESS$ -s test -p 12489  -v COUNTER -l "\\Terminal Services\Inactive Sessions"
}

Define Services:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
define service {
    hostgroup_name                  windows-nsclient-version
    service_description             NSClient++ Version
    check_command                   check_win!CLIENTVERSION
     use                             generic-service
    notification_interval           0 ; set > 0 if you want to be renotified
}
 
define service {
    hostgroup_name                  windows-nsclient-uptime
    service_description             Uptime
    check_command                   check_win!UPTIME
    use                             generic-service
    notification_interval           0 ; set > 0 if you want to be renotified
}
 
define service {
    hostgroup_name                  windows-nsclient-load
    service_description             CPU Load
    check_command                   check_win!CPULOAD!-l 5,80,90
    use                             generic-service
    notification_interval           0 ; set > 0 if you want to be renotified
}
 
define service {
    hostgroup_name                  windows-nsclient-memory
    service_description             Memory Usage
    check_command                   check_win!MEMUSE!-w 80 -c 90
    use                             generic-service
    notification_interval           0 ; set > 0 if you want to be renotified
}
 
define service {
    hostgroup_name                  windows-nsclient-hdd
    service_description             C:\ Drive Space
    check_command                   check_win!USEDDISKSPACE!-l c -w 80 -c 90
    use                             generic-service
    notification_interval           0 ; set > 0 if you want to be renotified
}
 
define service {
    hostgroup_name                  windows-nsclient-terminal-active
    service_description             RDP-Sessions: Active
    check_command                   check_terminal_active
    use                             generic-service
    notification_interval           0 ; set > 0 if you want to be renotified
}
 
define service {
    hostgroup_name                  windows-nsclient-terminal-inactive
    service_description             RDP-Sessions: Inactive
    check_command                   check_terminal_inactive
    use                             generic-service
    notification_interval           0 ; set > 0 if you want to be renotified
}
 
define service {
    hostgroup_name                  windows-nsclient-process-explorer
    service_description             Explorer.exe
    check_command                   check_win!PROCSTATE!-d SHOWALL -l Explorer.exe
    use                             generic-service
    notification_interval           0 ; set > 0 if you want to be renotified
}
 
define service {
    hostgroup_name                  windows-nsclient-process-taskmgr
    service_description             Taskmgr.exe
    check_command                   check_win!PROCSTATE!-d SHOWALL -l taskmgr.exe
    use                             generic-service
    notification_interval           0 ; set > 0 if you want to be renotified
}
 
define service {
    hostgroup_name                  windows-nsclient-process-nsclient
    service_description             Nsclient++.exe
    check_command                   check_win!PROCSTATE!-d SHOWALL -l nsclient++.exe
    use                             generic-service
    notification_interval           0 ; set > 0 if you want to be renotified
}

Define Hostgroups
Shorted example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
define hostgroup {
    hostgroup_name          windows-nsclient-version
    alias                   NSClient++ Version
    members                 windows2008r2
}
 
define hostgroup {
    hostgroup_name          windows-nsclient-uptime
    alias                   Windows Uptime
    members                 windows2008r2
}
 
define hostgroup {
    hostgroup_name          windows-nsclient-load
    alias                   Windows CPU Load
    members                 windows2008r2
}
 
define hostgroup {
    hostgroup_name          windows-nsclient-memory
    alias                   Windows Memory Usage
    members                 windows2008r2
}
 
define hostgroup {
    hostgroup_name          windows-nsclient-hdd
    alias                   Windows HDD Usage
    members                 windows2008r2, windows7
}
 
define hostgroup {
    hostgroup_name          windows-nsclient-terminal-active
    alias                   Active RDP-Sessions
    members                 windows2008r2
}

0 Responses to “Icinga/Nagios: Windows monitoring”


  • No Comments

Leave a Reply