zeldor.biz

Linux, programming and more

Copyright © 2023
Log in

Icinga/Nagios: Windows monitoring

February 22, 2012 by Igor Drobot 1 Comment

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 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 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
}

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 }

Filed Under: Linux, Monitoring, Networking Tagged With: Icinga, Monitoring, Nagios, NSClient++, SNMP

Categories

Archives

Tags

apache2 Apple arduino ARM Automation backup bash Cisco Cluster Corosync Database Debian Debian squeeze DIY DNS Fedora FTP Fun Icinga Ipv6 KVM Linux LVM MAC OS X Monitoring MySQL Nagios Nginx openSUSE OpenVPN PHP Proxy Python python3 qemu RAID rsync Samba security ssh Ubuntu virtualization Windows Windows 7 Wordpress

Trackbacks

  1. Runny says:
    March 17, 2013 at 18:11

    It’s a shame you don’t have a donate button! I’d without a doubt donate to this fantastic blog! I suppose for now i’ll settle for bookmarking and adding your RSS feed to my Google account. I look forward to new updates and will share this blog with my …

Leave a Reply

Your email address will not be published. Required fields are marked *