Вы находитесь на странице: 1из 63

Nagios

, Solar Winds,
3COM Network Superviser HP OpenView -
.
Nagios

OSS (Operations Support Systems)
.
Nagios
.
Big Brother, Angel Network Monitor, HiWayS, MARS, Autostatus, NocMonitor, RITW,
Zabbix, NetXMS, OpenNMS .
.
, sms ,
- .
, . ,
, Nagios
, .
SMS.
, Nagios,
, Tom Welsh
. http://nagios.square-box.com/.
guest guest.
Nagios SMTP, TELNET,
SSH, HTTP, DNS, POP3, IMAP, NNTP .
, ,
.
.
, .

. , ,
. Nagios
wap
. "" ,
. ,
. , ,
, , -
. Nagios
.
Nagios , ,
.

. - 20
. -
.
, .
Nagios .
Nagios NetSaint.
, NetSaint ,
Nagios.
Nagios. Nagios Linux,
FreeBSD 4.5.
, Nagios, ,
Unix . web- Nagios
Apache. , ,
Apache, Unix
web-. web-,
, .
GD Graphics, Thomas
Boutel. PNG, JPEG WBMP.
.
WBMP,
. 2.0.6 GIF,
- .
GIF LZW.
Unisys. ,
PNG
JPEG. , GD zlib, LibPng jpeg.
, .
.
, ,
. ,
"
".
- zlib, - Jean-loup Gailly
Mark Adler. API .
,
, .
http://www.gzip.org/zlib.
1.1.4. .
# tar zvxf zlib-1.1.4.tar.gz
# cd zlib-1.1.4
# ./configure
# make test
# make install

, LibPng PNG.
1.2.5. :
http://www.graphicswiz.com/png/libpng.html
LibPng - .
# tar zxvf libpng-1.2.5.tar.gz
# cd libpng-1.2.5

, scripts
makefile .
makefile.freebsd.
# cp ./scripts/makefile.freebsd Makefile

zlib zlib
*.h
# mkdir zlib

. .
# make all
# make test

- :
Testing pngtest.png:
Pass 0: rwrwrwrwrwrwrwrwrw
Pass 1: rwrwrwrwrwrwrwrwrw
Pass 2: rwrwrwrwrwrwrwrw
Pass 3: rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
Pass 4: rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
Pass 5: rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
Pass 6: rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
PASS (9782 zero samples)
Filter 0 was used 21 times
Filter 1 was used 15 times
Filter 2 was used 52 times
Filter 3 was used 10 times

Filter 4 was used 33 times


tIME = 7 Jun 1996

17:58:08 +0000

Current memory allocation:

0 bytes

Maximum memory allocation:

337346 bytes

Total

memory allocation:

Number of allocations:

1023516 bytes
198

libpng passes test

/usr/local/include/libpng/
# mkdir /usr/local/include/libpng

. .
# make install

http://www.ijg.org/files/ jpeg 6b. ,


,
jpeg. , ,
.
# tar zxvf jpegsrcv6b.tar.gz
# cd jpeg-6b
# ./configure
# make

:
# make test
rm -f testout*
./djpeg -dct int -ppm -outfile testout.ppm

./testorig.jpg

./djpeg -dct int -bmp -colors 256 -outfile testout.bmp


./cjpeg -dct int -outfile testout.jpg

./testorig.jpg

./testimg.ppm

./djpeg -dct int -ppm -outfile testoutp.ppm ./testprog.jpg


./cjpeg -dct int -progressive -opt -outfile testoutp.jpg ./testimg.ppm
./jpegtran -outfile testoutt.jpg ./testprog.jpg
cmp ./testimg.ppm testout.ppm
cmp ./testimg.bmp testout.bmp

cmp ./testimg.jpg testout.jpg


cmp ./testimg.ppm testoutp.ppm
cmp ./testimgp.jpg testoutp.jpg
cmp ./testorig.jpg testoutt.jpg

jpeg.
# make install

, GD.
http://www.boutell.com/gd/. ,
.
# tar zxvf gd-2.0.6.tar.gz
# cd gd-2.0.6
# ./configure --x-includes=/usr/local/include --x-libraries=/usr/local/lib

--x-includes --x-libraries ,

.
# make all

, ,
make.
# make devclean

1 GD 2.0.11 .
# make distclean


.
configure,
.
, .
# make install

.

GD, zlib, LibPng jpeg .

GD, , , ,

.

# cd /usr/ports/graphics/gd
# make install

. ,
, , .
, ,
FreeBSD.

. CD
sysinstall.
# /stand/sysinstall

, ,
.
Configure->Packages->CD/DVD->graphics->gd-1.8.4_3->ok->install->ok
, pkg_add. ,
. /usr/local/lib,
/usr/local/include/gd. , , ,
. ,
. .

. Nagios
.
.
Nagios - ,
core program, plugins.

.
Nagios
.

http://www.nagios.org/download/.
nagios-1.0b6 nagiosplug-1.3-beta1. ,
.
# tar zxvf nagios-1.0b6.tar.gz
# cd nagios-1.0b6

, Nagios.
/usr/local/nagios/. , ,
.

. ,

. , ,
. , .
# mkdir /usr/local/nagios

adduser -
nagios, nagios.
# adduser nagios
# ./configure --prefix=/usr/local/nagios --with-cgi-url=/nagios/cgi-bin --withhtml-url=/nagios/ \
--with-nagios-user=nagios --with-nagios-grp=nagios --with-gdlib=/usr/local/lib \
--with-gd-inc=/usr/local/include/gd


.
--prefix=/usr/local/nagios - .
/usr/local/nagios.
--with-cgi-url=/nagios/cgi-bin - URL CGI
web- nagios. URL "/" .
somesite.ru URL
CGI httt://somesite.ru/nagios/cgi-bin/statusmap.cgi.
--with-html-url=/nagios/ - URL html ,
web- .
--with-nagios-user=nagios - , .
--with-nagios-grp=nagios - .
--with-gd-lib=/usr/local/lib - GD
--with-gd-inc=/usr/local/include/gd - .
configure,
.
# make all
# make install

, .
make install-init , Nagios
.
Nagios stop, reload, start, restart, reload, force-reload.
.

start - Nagios.
stop - Nagios.
restart - Nagios
reload - Nagios SIGHUP,
,
force-reload -
status -
FreeBSD /usr/local/etc/rc.d
nagios.sh.
, ,
. , Slackware
/etc/rc.d/init.d rc.nagios. ,
.
# make install-init

:
/usr/bin/install -c -m 755 -d -o root -g root /usr/local/etc/rc.d
install: unknown group root
*** Error code 67
Stop in /tmp/nagios-1.0b6.

, . , ,
, .
Makefile.
32
INIT_OPTS=-o root -g root
, , FreeBSD root
wheel. .
INIT_OPTS=-o root -g wheel
154
$(INSTALL) -m 774 $(INIT_OPTS) daemon-init $(DESTDIR)$(INIT_DIR)/nagios
nagios.sh nagios.
. 100.
:

$(INSTALL) -m 100 $(INIT_OPTS) daemon-init $(DESTDIR)$(INIT_DIR)/nagios.sh


.
# make install-init

, , . ,
nagios.sh ,
start. .
:
echo "Usage: nagios {start|stop|restart|reload|force-reload|status}"
:
/usr/local/etc/rc.d/nagios.sh start
nagios.sh,
, start. FreeBSD 4.6.2

.
- , ,
Nagios. ,
/usr/local/nagios/var/rw/nagios.cmd. , ,
/usr/local/nagios/var/rw/ . ,
nagios.cmd.
,
NagiosCmd=${prefix}/var/rw/nagios.cmd
:
NagiosCmd=${prefix}/var/nagios.cmd
nagios.cmd /usr/local/nagios/var/.
, , nagios.cmd.
Nagios ,
. , nagios.cmd . ,
nagios nagios. ,
. , ,
Nagios web-. Apache
nobody nogroup. , web nagios.cmd.
,
.
nobody nagios. .

nobody. nobody
nagios.

, nagios, web-.
nagios.sh
sleep 1
status_nagios nagios

touch $NagiosCmd
chown nobody $NagiosCmd
nagios.sh, , - ,
.
make install-config ,
/usr/local/nagios/etc/.
# make install-config

/usr/local/nagios/, ,
5 .
# ls /usr/local/nagios
bin

etc

sbin

share

var

, .
bin - . Nagios.
etc -
sbin - CGI web-
share - html web-
var -
Nagios.
. ,
.
. ,
,
.
.
. , ,
. Nagios ,
, .

. make,

, .
gmake.
# tar zxvf nagiosplug-1.3-beta1.tar.gz
# cd nagiosplug-1.3-beta1
# ./configure --prefix=/usr/local/nagios --with-nagios-user=nagios
nagios-grp=nagios

--with-

,
.
./configure help.
# gmake all
# gmake install


/usr/local/nagios/libexec. , perl. ,
. .
Nagios,
. .
help -h,
Nagios. .
, check_dns.
# check_dns -h
check_dns (nagios-plugins 1.3.0-alpha1) 1.1.1.1
The nagios plugins come with ABSOLUTELY NO WARRANTY. You may
copies of the plugins under the terms of the GNU General Public
For more information about these matters, see the file named
Copyright (c) 1999 Ethan Galstad (nagios@nagios.org)
Usage: check_dns -H host [-s server] [-t timeout]
check_dns --help
check_dns --version
-H, --hostname=HOST

The name or address you want to query

-s, --server=HOST
Optional DNS server you want to use for the lookup
-t, --timeout=INTEGER
Seconds before connection times out (default: 10)
-h, --help

redistribute
License.
COPYING.

Print detailed help


-V, --version
Print version numbers and license information
This plugin uses the nslookup program to obtain the IP address
for the given host/domain query.
be specified.

A optional DNS server to use may

If no DNS server is specified, the default server(s)

specified in /etc/resolv.conf will be used.

, , check_dns
H -s, -t. ,
H . -s
DNS, ,
. -t ,
. DNS 192.168.10.254
.
# check_dns -H 192.168.10.254
DNS ok - 0 seconds response time, Address(es) is/are 192.168.10.254

, DNS .
,
Nagios.
.
# cd /usr/local/nagios/etc
# ll
total 92
-rw-rw-r--

1 nagios

nagios

17028 Nov 11 15:41 cgi.cfg-sample

-rw-rw-r--

1 nagios

nagios

4480 Nov 11 15:41 checkcommands.cfg-sample

-rw-rw-r--

1 nagios

nagios

1577 Nov 11 15:41 contactgroups.cfg-sample

-rw-rw-r--

1 nagios

nagios

1485 Nov 11 15:41 contacts.cfg-sample

-rw-rw-r--

1 nagios

nagios

1651 Nov 11 15:41

-rw-rw-r--

1 nagios

nagios

2022 Nov 11 15:41 escalations.cfg-sample

-rw-rw-r--

1 nagios

nagios

1658 Nov 11 15:41 hostgroups.cfg-sample

-rw-rw-r--

1 nagios

nagios

5774 Nov 11 15:41 hosts.cfg-sample

-rw-rw-r--

1 nagios

nagios

4277 Nov 11 15:41 misccommands.cfg-sample

-rw-rw-r--

1 nagios

nagios

dependencies.cfg-sample

21332 Nov 11 15:41 nagios.cfg-sample

-rw-rw----

1 nagios

nagios

3074 Nov 11 15:41 resource.cfg-sample

-rw-rw-r--

1 nagios

nagios

17668 Nov 11 15:41 services.cfg-sample

-rw-rw-r--

1 nagios

nagios

1594 Nov 11 15:41 timeperiods.cfg-sample

-sample, ,
, . ,
, , sample.
, - .
# mkdir sample
# cp * ./sample

, -sample. ,
, Nagios .
- :
# ll
total 94
-rw-rw-r--

1 nagios

nagios

17028 Nov 11 16:13 cgi.cfg

-rw-rw-r--

1 nagios

nagios

4480 Nov 11 16:13 checkcommands.cfg

-rw-rw-r--

1 nagios

nagios

1577 Nov 11 16:13 contactgroups.cfg

-rw-rw-r--

1 nagios

nagios

1485 Nov 11 16:13 contacts.cfg

-rw-rw-r--

1 nagios

nagios

1651 Nov 11 16:13 dependencies.cfg

-rw-rw-r--

1 nagios

nagios

2022 Nov 11 16:13 escalations.cfg

-rw-rw-r--

1 nagios

nagios

1658 Nov 11 16:13 hostgroups.cfg

-rw-rw-r--

1 nagios

nagios

5774 Nov 11 16:13 hosts.cfg

-rw-rw-r--

1 nagios

nagios

4277 Nov 11 16:13 misccommands.cfg

-rw-rw-r--

1 nagios

nagios

-rw-rw----

1 nagios

nagios

drwxr-xr-x

2 root

nagios

-rw-rw-r--

1 nagios

nagios

-rw-rw-r--

1 nagios

nagios

21332 Nov 11 16:13 nagios.cfg


3074 Nov 11 16:13 resource.cfg
512 Nov 11 16:07 sample
17668 Nov 11 16:13 services.cfg
1594 Nov 11 16:13 timeperiods.cfg

, . Nagios ,
. ,
, .

.
. .

# cp /dev/null hosts.cfg services.cfg contacts.cfg contactgroups.cfg


hostgroups.cfg
# cp /dev/null dependencies.cfg escalations.cfg

1.0b2, Nagios
.
.
mail.firma.ru proxy.firma.ru.
, , .

.
hosts.cfg
#
define host{
name
generic-host
# -
notifications_enabled
1
#
event_handler_enabled
1
#
flap_detection_enabled
1
#
process_perf_data
1
#
retain_status_information
1
#
retain_nonstatus_information 1
#
register
0
# , - .
#
}
# mail
define host{
use
generic-host
#

host_name
#

mail

alias
Mail Server
#
address
mail.firma.ru
# fqdn
check_command
check-host-alive
# ping.
# checkcommands.cfg
max_check_attempts
10
# ,
# .
notification_interval 120
# ,
# , .
notification_period 24x7
# ,
# . .
# timeperiods.cfg.
notification_options d,u,r
# ,
# . d,u,r (DOWN, UNREACHABLE, RECOVERY)
# "", "", "".
}
# proxy
define host{
use
generic-host
host_name
proxy
# . alias address.
alias
Proxy Server
address
proxy.firma.ru
check_command
check-host-alive
max_check_attempts
10
notification_interval 120
notification_period 24x7
notification_options d,u,r
}
. ,
Nagios ,
. ,
, hostgroups.cfg. ,
. , .

hostgroups.cfg
define hostgroup{
hostgroup_name firma-servers
#
alias
Firma Servers
#
contact_groups firma-admins
# ,
members
mail proxy
# ,
}
, .
,
. . , ,
HTTP PING, proxy.firma.ru. ,
mail.firma.ru, SMTP IMAP.
services.cfg
#
define service{
name generic-service
#
active_checks_enabled 1
#
passive_checks_enabled 1
#
parallelize_check 1
# ,
#
obsess_over_service 0
#
# .
check_freshness 0
# .
notifications_enabled 1
#
event_handler_enabled 1

#
flap_detection_enabled 1
#
process_perf_data 1
#
retain_status_information 1
# Nagios
retain_nonstatus_information 1
# Nagios
register 0
#
}
# HTTP proxy.firma.ru
define service{
use generic-service
#
hostname proxy.firma.ru
#
service_description HTTP
#
is_volatile 0
# 0
# ,
# ""
# , .
check_period 24x7
# ,
max_check_attemps 3
#
normal_check_interval 5
#
retry_check_interval 1
# . ,
#
contact_groups firma-admins
# ,

notification_interval 120
# ( ), ,
#
notification_period 24x7
# ,
notification_options w,u,c,r
# ,
# .
check_command check_http
# ,
}
# PING proxy.firma.ru
define service{
use generic-service
#
hostname proxy.firma.ru
#
service_description PING
#
is_volatile 0
check_period 24x7
# ,
max_check_attempts 3
#
normal_check_interval 5
#
retry_check_interval 1
# . ,
#
contact_groups firma-admins
# ,
notification_interval 120
# ( ), ,
#
notification_period 24x7
# ,

notification_options w,u,c,r
# ,
# .
check_command check_ping
# ,
}
# SMTP mail.firma.ru
define service{
use generic-service
hostname mail.firma.ru
service_description SMTP
#
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups firma-admins
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_smtp
# ,
}
# IMAP mail.firma.ru
define service{
use generic-service
hostname mail.firma.ru
service_description IMAP
#
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups firma-admins
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_imap
# ,
}
, , , ,

, check_command.
checkcommands.cfg.
check_imap , , ,
/usr/local/nagios/libexec/, check_imap .
, Nagios. ,
. checkcommands.cfg
:
# 'check_imap' command definition
define command{
command_name check_imap
command_line $USER1$/check_imap -H $HOSTADDRESS$
}
hosts.cfg services.cfg .
,
.
, ,

. Nagios contacts.cfg
- .
, .
contacts.cfg
define contact{
contact_name
#
alias
#

tigrisha
Andrei Beshkov

service_notification_period 24x7
# ,
#
host_notification_period
24x7
# ,
#
service_notification_options w,u,c,r
# ,
# .
host_notification_options
d,u,r
# ,
# .
service_notification_commands notify-by-email, notify-by-epager
#
host_notification_commands

host-notify-by-email, host-notify-by-epager

#
email
#

admin@firma.ru

pager
143652565@pager.icq
#
}
define contact{
contact_name
#
alias
#

amon
Dmitry Larin

service_notification_period 24x7
# ,

host_notification_period
24x7
# ,
service_notification_options w,u,c,r
# ,
# .
host_notification_options
d,u,r
# ,
# .
service_notification_commands notify-by-email, notify-by-epager
#
host_notification_commands
host-notify-by-email, host-notify-by-epager
#
email
#

amon@firma.ru

pager
177345865@pager.icq
#
}
.
, .
contactgroups.cfg
define contactgroup{
contactgroup_name
firma-admins
#

alias
firma.ru Admins
#
members
tigrisha amon
#
}
dependencies.cfg . escalations.cfg,
, . ,
, .
, , .
,
.
- .
, Nagios
. ,
.
1) .
2) .
3) .
4) , .
. ,

. nagios.sh.
# /usr/local/etc/rc.d/nagios.sh

: Nagios ,
.
Starting network monitor: nagios
/bin/sh:

-l: unrecognized option

, .
, , ,
-l su. FreeBSD .
su -. /usr/local/etc/rc.d/ nagios.sh ,
su -l l. - , .
Nagios. , ,
status.
# /usr/local/etc/rc.d/nagios.sh

status

PID

TT

STAT

101

??

Ss

TIME COMMAND
0:20.81 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc

, , Nagios ,
, /usr/local/nagios/
nagios nagios.
, .
# chown -R nagios:nagios /usr/local/nagios/

, , Nagios .
#

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg


. .
. , ,

, .
Nagios
, . ,
, . ,
.
, ,
web-. ,
, , web- Apache.
.
Apache httpd.conf :
<Directory "/usr/local/apache/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>

:
ScriptAlias /nagios/cgi-bin/ "/usr/local/nagios/sbin/"
<Directory "/usr/local/nagios/sbin/">
AllowOverride AuthConfig
Options ExecCGI

Order allow,deny
Allow from all
</Directory>
Alias /nagios/ /usr/local/nagios/share/
<Directory "/usr/local/nagios/share/">
AllowOverride AuthConfig
Options None
Order allow,deny
Allow from all
</Directory>

, . - cgi nagios,
"/usr/local/nagios/sbin/". ,
http http:// /nagios/cgi-bin/.
, /usr/local/nagios/share/ html
web- . ,
http:// /nagios/. , .
, .htaccess
/usr/local/nagios/sbin/ :
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
require valid-user

Apache.
# /usr/local/apache/bin/apachectl restart

, web-,
/usr/local/nagios/sbin/ .
,
Nagios , .htaccess
/usr/local/nagios/sbin/ /usr/local/nagios/share/.

/usr/local/nagios/etc/htpasswd.users,
.
c .
# /usr/local/apache/bin/htpasswd -c /usr/local/nagios/etc/htpasswd.users
tigrisha

New password: ******


Re-type new password: ******

Adding password for user tigrisha

, , .
# /usr/local/apache/bin/htpasswd /usr/local/nagios/etc/htpasswd.users amon
New password: ******
Re-type new password: ******
Adding password for user amon

/usr/local/nagios/etc/cgi.cfg.
:
authorized_for_system_information=tigrisha, amon
# ,
# Nagios
authorized_for_configuration_information= tigrisha, amon
# ,
# .
#
# ,
# .
authorized_for_system_commands=tigrisha, amon
# ,
# cmd.cgi Nagios.
authorized_for_all_services=tigrisha, amon
authorized_for_all_hosts=tigrisha, amon
# ,
# .
#
# , .
refresh_rate=10
# ( ) , web-.
# 90 , .
# 10 .
nagios.cfg
date_format=euro
#
use_authentication=1

#
check_external_commands=1
# , Nagios web-.
command_file=/usr/local/nagios/var/nagios.cmd
# .
, Nagios:
# /usr/local/etc/rc.d/nagios.sh restart

,
. .
.

Windows
Nagios
Nagios
FreeBSD 4.7. Linux, Solaris Unix-
.
.
Windows 2000 Professional. ,
,
. , ,
.
Windows.
Windows NT, Windows 2000, Windows XP
. Windows 2003
, .
(performance
counters) . ,
.
.
.

- , , . ,
.
" "
Internet Information Server. , " "
,
, .
, .
"", "", "". " " "", , .
, , ,
. ,

, , .
, .
, ,
.
, -. , ,
Windows 2000:

Committed Bytes
Byte vincolati
Zugesicherte Bytes

Octets dedies
Bytes comprometidos
Bytes confirmados

, , ,
. ,
.
Windows.
Windows.
, :
\\TIGROID\(_Total)\%
\\TIGROID\(0)\%
\\TIGROID\(1)\%
- ,
. "" - .
, (_Total) - ,
. , (0) (1)-
. , , "% " .
. ,
.
:
.
\ (_Total)\ .
,
. \\/.,
.
.
Platform Software Development Kit. ,
. ,
, "

", Microsoft.
, , perfmon.exe.
.

, .
, .
. , .
"+",

,
, . , ,
, .
"",
. ,
- "% DPC"? ,

.

. , "".
"".
"".

- ,
.
.
.
test.html .

.
.
Windows
, , .
Windows win2000rus. ,
, Nagios .
.
hosts.cfg.
# win2000rus
define host{
use generic-host
host_name win2000rus
alias Windows 2000 Russian
address win2000rus
check_command check-host-alive
max_check_attempts 10
notification_interval 120
notification_period 24x7
notification_options d,u,r
}
hostgroups.cfg .
define hostgroup{

hostgroup_name win-servers
alias Windows Servers
contact_groups win-admins
members win2000rus
}
contacts.cfg , Windows .
define contact{
contact_name serge
alias Sergei Petrov
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,u,r
service_notification_commands notify-by-email, notify-by-epager
host_notification_commands host-notify-by-email, host-notify-by-epager
email serge@test.ru
pager 172345885@pager.icq
}
win-admins contactgroups.cfg
define contactgroup{
contactgroup_name win-admins
alias Windows admins
members serge
}

NSClient

. , Windows NSClient,
NetSaint. ,
Windows.
,
24 . ,
1248- .
check_nt Nagios.
, Windows
check_nt:

24






, .
http://nsclient.ready2run.nl/download.htm
NSClient. 1.0.7.1.
:

LinuxBin
UnixSource
NTSource
Win_2k_XP_Bin
Win_NT4_Bin

Linux
Unix
Windows
Windows 2000 XP
Windows NT

NTSource, - Delphi. ,

. c:\Program Files\NSClient. ,
,
Win_2k_XP_Bin, Win_NT4_Bin. ->
cmd.exe. :
> C:\Program Files\NSClient\pNSClient /install

, .
regedit .
\HKEY_LOCAL_MACHINE\SOFTWARE\NSClient\Params.
password port. , .
- ,
,
. password - , , "PxRT890mY".

, 1248,
.
, NetSaint NT agent.
->-> .
"", "".
- :

"NSClient 1.0.7.0 has started. Language code :


0x0419", , ,
. 0x0419, , , 0x0409.
C:\Program Files\NSClient\counters.defs
. , , 0x0419
. - Windows
. , ,
counters.defs ,
:
[0x0419]
Description = "Russian"
NT4_SystemTotalProcessorTime = "\\% "

NT4_SystemSystemUpTime = "\\ "


NT4_MemoryCommitLimit = "\\ "
NT4_MemoryCommitByte = "\\ "
W2K_SystemTotalProcessorTime = "\(_Total)\% "
W2K_SystemSystemUpTime = "\\ "
W2K_MemoryCommitLimit = "\\ "
W2K_MemoryCommitByte = "\\ "
, NetSaint NT agent. ,
,
http://onix.opennet.ru/files/. ,
. ,
:
NSClient is now responding to queries.
NSClient 1.0.7.0 has started. Language code : 0x0419
NSClient is reading C:\Program Files\NSClient\counters.defs for counters
definitions. Language code : 0x0419
NSClient has stopped

Windows, Unix. , Nagios


/usr/local/nagios/. nagios,
nagios. , FreeBSD.
,
. http://www.nagios.org/download/
. nagiosplug-1.3-beta1.tar.gz.

# tar zxvf nagiosplug-1.3-beta1.tar.gz

, , Nagios,
check_nt. ,
.
. , Windows, check_nt.c , UnixSource,
, Unix- ./nagiosplug-1.3-beta1/plugins/.
. , FreeBSD
Solaris. ./nagiosplug-1.3-beta1/plugins/utils.c :
nchars = vsnprintf (str, size, fmt, ap);
, :
nchars = vsprintf (str, fmt, ap);
, check_nt
:
Memory usage: total:??????? Mb - used: ??????? Mb (???????%) - free: ??????? Mb
(???????%)

c:\ - total: ??????? Gb - used: ??????? Gb (???????%) - free ??????? Gb (???????


%)
CPU Load (1 min. 12???????

. ,
. ,
, , .
# cd ..
# ./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --withnagios-grp=nagios
# gmake all
# gmake install

, gmake
make.
:
Making all in plugins
/tmp/nagiosplug-1.3-beta1/plugins/Makefile,
line 760: Need an operator
make: fatal errors encountered cannot continue
*** Error code 1

, ,
Nagios .
checkcommands.cfg. .
define command{.
command_name .
command_line
, Nagios.
$USER1$, $HOSTADDRESS$, $ARG1$, $ARG2$.
, :
$USER1$ - , .
/usr/local/nagios/libexec/. resource.cfg
$HOSTADDRESS$ - IP , .
services.cfg
$ARG1$, $ARG2$ - , .
,
.
}. ,
checkcommands.cfg.
# win2000rus
# check_nt_cpuload .
#
define command{
command_name check_nt_cpuload
command_line $USER1$/check_nt -H $HOSTADDRESS$ -v CPULOAD -l $ARG1$ -s $ARG2$
}

# check_nt_memuse. .
# .
define command{
command_name check_nt_memuse
command_line $USER1$/check_nt -H $HOSTADDRESS$ -v MEMUSE -w $ARG1$ -c $ARG2$
-s $ARG3$
}
# check_nt_uptime.
#
define command{
command_name check_nt_uptime
command_line $USER1$/check_nt -H $HOSTADDRESS$ -v UPTIME -s $ARG1$
}
# check_nt_disk_space.
#
define command{
command_name check_nt_disk_space
command_line $USER1$/check_nt -H $HOSTADDRESS$ -v USEDDISKSPACE -l $ARG1$ -w
$ARG2$ -c $ARG3$ -s $ARG4$
}
# check_nt_service. ,
# -d SHOWALL,
# .
define command{
command_name check_nt_service
command_line $USER1$/check_nt -H $HOSTADDRESS$ -v SERVICESTATE -d SHOWALL -l
$ARG1$ -s $ARG2$
}
# check_nt_client_version
# NSClient.,
define command{
command_name check_nt_client_version
command_line $USER1$/check_nt -H $HOSTADDRESS$ -v CLIENTVERSION -s $ARG1$
}
# check_nt_file_age
#
define command{
command_name check_nt_file_age
command_line $USER1$/check_nt -H $HOSTADDRESS$ -v FILEAGE -l $ARG1$ -w $ARG2$
-c $ARG3$ -s $ARG4$
}
# check_nt_process. ,
# , .
# -d SHOWALL,
# .
define command{

command_name check_nt_process
command_line $USER1$/check_nt -H $HOSTADDRESS$ -v PROCSTATE -d SHOWALL -l
$ARG1$ -s $ARG2$
}
# check_nt_counter
# ,
# .
define command{
command_name check_nt_counter
command_line $USER1$/check_nt -H $HOSTADDRESS$ -v COUNTER -l $ARG1$ -w $ARG2$
-c $ARG3$ -s $ARG4$
}
, , .
Nagios.
check_command, ,
$ARG1$ .
check_command

check_nt_process!"calc.exe,notepad.exe,mspaint.exe"!PxRT890mY

check_command - , check_nt_process -
, checkcommands.cfg. ,
$ARG1$, $ARG2$, $ARG3$
. , ,
"calc.exe,notepad.exe,mspaint.exe" $ARG1$, PxRT890mY $ARG1$.
, services.cfg:
# .
# ,
# .
# "", "Paint", "",
# Windows
define service{
use generic-service
host_name win2000rus
service_description User Programs
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 1
retry_check_interval 1
contact_groups win-admins
notification_interval 120
notification_period 24x7
notification_options c,r
# ,
# , .
# Windows
# .
# .
check_command check_nt_process!"calc.exe,notepad.exe,mspaint.exe"!PxRT890mY

}
# NSClient ,
define service{
use generic-service
host_name win2000rus
service_description NSClient Version
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 1
retry_check_interval 1
contact_groups win-admins
notification_interval 120
notification_period 24x7
notification_options c,r
# . $ARG1$
check_command check_nt_client_version!PxRT890mY
}
#
# c:\upload\ update.dbf
#
# , 70 ,
# , - ,
# . , 90 ,
# .
define service{
use generic-service
host_name win2000rus
service_description File age
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 1
retry_check_interval 1
contact_groups win-admins
notification_interval 120
notification_period 24x7
notification_options c,r
# "\"
check_command check_nt_file_age!"c:\\upload\\update.dbf"!70!90!PxRT890mY
}
# ,
# . NSClient
# "\\ "
# 100.
# , ,
# .
# "\\ "
# . ,

# . ,
# . NSClient .
define service{
use generic-service
host_name win2000rus
service_description Free Memory
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 1
retry_check_interval 1
contact_groups win-admins
notification_interval 120
notification_period 24x7
notification_options c,r
# , 70% .
# , 90%
check_command check_nt_memuse!70%!90%!PxRT890mY
}
#
define service{
use generic-service
host_name win2000rus
service_description CPU Load
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 1
retry_check_interval 1
contact_groups win-admins
notification_interval 120
notification_period 24x7
notification_options c,r
# , 70% .
# , 90%
check_command check_nt_memuse!70%!90%!PxRT890mY
}
# .
define service{
use generic-service
host_name win2000rus
service_description Up time is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 1
retry_check_interval 1
contact_groups win-admins
notification_interval 120
notification_period 24x7
notification_options c,r

check_command check_nt_uptime!PxRT890mY
}
# , MS SQL SERVER
# vmxposman
define service{
use generic-service
host_name win2000rus
service_description Runing Services
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 1
retry_check_interval 1
contact_groups win-admins
notification_interval 120
notification_period 24x7
notification_options c,r
# , Windows
# , .
# ,
# Windows.
# HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services.,
# 'Service Manager NT' ,
#
# http://www-rnks.informatik.tu-cottbus.de/~fsch/english/nttols.htm
# ,
# .
check_command check_nt_service!"mssqlserver,vmxposman"
}
# ,
define service{
use generic-service
host_name win2000rus
service_description Print Queue
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 1
retry_check_interval 1
contact_groups win-admins
notification_interval 120
notification_period 24x7
notification_options c,r
# check_nt_counter, .
# - \ (_Total)\
# "%.0f job(s)"
# float .
# "job(s)".
# , -
# printf ( ) .

# 5
# , , 10 .
check_command check_nt_counter!"\ (_Total)\","%.0f job(s)"!5!10!
PxRT890mY
}
#
define service{
use generic-service
host_name win2000rus
service_description Paging File is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 1
retry_check_interval 1
contact_groups win-admins
notification_interval 120
notification_period 24x7
notification_options c,r
# check_nt_counter, .
# "Usage %.2f %%"
# float .
# "Usage".
# "%" .
# printf ( ) ,, "%".
#
# 80 , ,
# 90 . check_command check_nt_counter!"\ (_Total)\%
","Usage %.2f %%"!80%!90%!PxRT890mY }
, ,
, cp1251.
, NSClient , ,
. cp1251
Windows- . -
. , Unix
KOI8-R. , ,
cp1251, .
. FTP, checkcommands.cfg Windows-.
"" . ,
Unix /usr/local/nagios/etc/.
, . ,
.
koi8-r.
:
1.
2.
3.
4.
5.

siconv-0.2.1
fconv-1.1
ru-xcode-1.0
ru-dt1489-1.4
ru-mtc-1.3

, ru-mtc.
.
# cat checkcommands.cfg | mtc -f koi8 -t win 1251 > checkcommands.tmp
# mv checkcommands.tmp checkcommands.cfg

Nagios .
# /usr/local/etc/rc.d/nagios.sh restart

,

, Windows .

Windows
Nagios SNMP
, , c,
Nagios. , .

Nagios
Windows.

NSClient, check_nt.
.
SNMP (Simple Network Management Protocol). ,
,
Nagios. SNMP
Windows
, SNMP. ,
mrtg, OpenNMS, Dec PolyCenter Network Manager, HP Open View, IBM AIX NetView/600, IBM
Tivoli, Micromuse Netcool
.
.
, ,
SNMP, . , ,
, .
.
. .
, .
.
, .
- . ,
-
, ,
. SNMP
(SNMP Trap).

, , ,
. ,
. ,
:










,
IP- ,
,


, , ,

.
SNMP ,
, , ,
. , ,
. ,
, , - , ,
.
- MIB (Management Information Base)
- . ,
, ,
. MIB
.
SNMP.
System - (,
)
Interfaces - (, , , ,)
At (Address translation table) - . .
.
TCP - TCP ( , ,
)
ICMP - ICMP (
, )
EGP - (
, )

UDP - UDP ( , )
SNMP - (
, , )
IP - (
, )

. private.
,
. ,
SNMP, win2000rus.

,
. iso.org.dod.internet.mgmt.mib2.system.sysUpTime.
, .
, .

iso
org
dod
internet
mgmt
mib2
system


1
3
6
1
2
1
1

sysUpTime

, .1.3.6.1.2.1.1.3.
,
.iso.3.dod.1.mgmt.1.1.sysUpTime.
, .
. ,
, ,
. OID (Object identifier) ,
, " ".
, iso.org.dod.internet.mgmt.mib2 OID,
. ,
system.sysUpTime.
,
, . .
, system.sysUpTime ,
. ,
, "0". ,
system.sysUpTime, system.sysUpTime.0.

:
interfaces.ifTable.ifEntry.ifType -
interfaces.ifTable.ifEntry.ifIndex -

interfaces.ifTable.ifEntry.ifMtu -
, .
interfaces . .interfaces.ifNumber
"2", , .
interfaces.ifTable.ifEntry .
. .
interfaces.ifTable.ifEntry.ifIndex
. ,
. , ,
:
interfaces.ifTable.ifEntry.ifType.16777219
interfaces.ifTable.ifEntry.ifIndex.16777219
interfaces.ifTable.ifEntry.ifMtu.16777219
:
interfaces.ifTable.ifEntry.ifType.1
interfaces.ifTable.ifEntry.ifIndex.1
interfaces.ifTable.ifEntry.ifMtu.1
, ,
SNMP.
GetRequest - .
MIB. Get.
GetNextRequest - .
.
. , .
GetRequest .
, , . GetNextRequest.
. ,
. GetNext.
SetRequest - ,
MIB. Set.
GetResponse - GetRequest, GetNextRequest,
SetRequest. ,
, ,
. Reply
Response.
Trap - OID, ,
, MIB
. - , .
- " " (Community Names).
, ,
.
,
. ,

. Read-Only, Read-Write,
Read-Create Trap. GetRequest, GetNextRequest,
Read-Only .
SetRequest,
MIB. read-write.

Read-Write. ,
.
Trap .

. ,
, .
SNMP UDP 162.
UDP ,
.
. SNMP
ATM, Ethernet, IPX.
SNMP ,
.
"public".

. SNMP
.
, SNMP
. , .
.
, SNMP "Security Not My Problem".
SNMP.
Symmetric Privacy Protocol (SPP),
, Digest Authentication
Protocol (DAP). , SNMP v.2 ,
, , ,
SetRequest.
. , ,
.
SNMP .
IP ,
, .
- SNMP,
. ,
snmp faq. , ,
, .
RFC 1156, 1213, 1157, 1146, 2571, 2574. SNMP,
.
, win2000rus SNMP,
. ->-

> . " ".


" Windows".

" ".

"" " SNMP"


.

"" "" .
, . " SNMP"
. ,
, , , ,
" SNMP".

SNMP. Read-Only public


"QWEmn90" Read-Wrie, , "Zxasd098".


, SNMP. ,
Read-Write .
, SNMP,
Nagios Windows ,
. , Windows - ,
SNMP, .
SNMP,
.
, .
Windows SNMP. - ,
SNMP .
Windows MS SMS Netmon
http://www.microsoft.com/smsmgmt/.
GetIf 2.2, http://www.wtcs.org/snmp4tpc/FILES/Tools/SNMP/getif/getif2.2.zip. , , ,
SNMP. 2.3.
- .
"Next". ,
SNMP . Unix -
http://snmpbrowser.sourceforge.net/.
GetIf. ,
SNMP .
SNMP . "Host Name"
Windows . "Read commuinty" "Write
community" "QWEmn90" "Zxasd098". "Start".
, "error" "none" -

, SNMP .

MBrowser,
. , , - ,
"iso". , , OID
iso.org.dod.internet.mgmt.mib-2.system.sysDescr, .
, "Walk".

- .
, . OID
.
MIB. 4 , .
(Type), (Access), ,
(Enums). , OID,

.iso.org.dod.internet.mgmt.mib-2.IfTable.IfTable.IfEntry.IfOperStatus,
"up", "down", "testing". (Status) -
. ,
. , , ,
, .
,
. , ,
, "Walk".
, . ,
, .
, ,
Read-Write. OID,
. , ,
"Set" . ,
, . , ,
GetIf, , -
. , MIB, ,
MIB OID.
MIB http://www.wtcs.org/snmp4tpc/FILES/Tools/SNMP/getif/GETIFMIBS.ZIP. ,
.mib , GetIf. C:/Program
Files/GetIf 2.2/Mibs/. .index,
, MIB. Getif, .index
MIB . MBrowser,
. ,
:

Mib_ii
MIB_II_TRANSMISSION
RFC_BASE_MINIMUM
PRIVATE_ENTERPRISES/Microsoft_win2k
PRIVATE_ENTERPRISES/Microsoft_Apps

, OID,
.
.iso.org.dod.internet.mgmt.mib2.host.hrDevice.hrProcessorTable.hrProcessorEntry.hrProcessorLoad
, , Windows SNMP,
. ,
. ,
(performance counters), ,
SNMP. ,
SNMP4W2K. Windows NT, , SNMP4NT.
.
SNMP4W2K-STD SNMP4NT-STD. ,
SNMP4W2K-PLUS SNMP4NT-PLUS.
Windows NT , SNMP4NT-PLUS,
.
. MIB 50$

. , ,
Windows:
Print Services
SMTP Services
NNTP Services
,
:

SQL Server 2000


Exchange Server 2000
ISA Server
Media Services
Active Directory
IIS Global Services

, ,
.
http://www.wtcs.org/snmp4tpc/FILES/SNMP4W2K/STD/SNMP4W2K-STD.zip
SNMP4W2K. ,
Window NT
http://www.wtcs.org/snmp4tpc/. ""
" ".

SNMP, Windows
SNMP perfmib.dll, , mib.bin
, perfmib.ini,

. OID
mib.bin. ,
SNMP4W2K-STD. SNMP4W2K-STD.exe.
, C:\Program Files\SNMP4W2K-STD\.
,
"View Readme File" "Run Installed Application".
"".
, . ,
, "Y".
SNMP.
SNMP , . , , SNMP4W2K,
GetIf, MIB SNMP4W2K,
C:\Program Files\SNMP4W2K-STD\Mibs\ , MIB
C:\Program Files\Getif 2.2\Mibs\. .index , GetIf,
.iso.org.dod.internet.private.enterprises. ,
, SNMP4W2K.
SNMP4W2K. , ,
SNMP4W2K,
SNMP4W2K. - IIS.
SNMP4W2K, OID,
, , SNMP4W2K
IIS, , MIB .
- IIS, SNMP4W2K,
.
. SNMP4W2K.
WINS, SMTP, DNS

.iso.org.dod.internet.private.enterprises.microsoft.software.systems.os.windowsNT.performance.
, OID
. , OID:
.iso.org.dod.internet.private.enterprises.microsoft.software.systems.os.windowsNT.performance.
cpuprocessorTable.cpuprocessorEntry.cpuPercentProcessorTime.
! OID .
.
, SNMP . ,
, .
OID
.iso.org.dod.internet.private.enterprises.microsoft.software.systems.os.windowsNT.performance.me
mmory.memmoryCommitLimit, "\\
", 100 , ,
.
3.184.967 . ,
.
.iso.org.dod.internet.private.enterprises.microsoft.software.systems.os.windowsNT.performance.me
mmory.memmoryCommittedBytes, "\\
". 53776337 .

, 3184967 , 16.88%. ,
.
90% - 286647030
80% - 254797360 , Nagios
.
, -
Windows . ,
.iso.org.dod.internet.private.enterprises.microsoft.software.systems.os.windowsNT.performance.pdi
skphysicalDiskTable
.iso.org.dod.internet.private.enterprises.microsoft.software.systems.os.windowsNT.performance.ldis
klogicalDiskTable,
. . OID,
SNMP4W2K, .iso.org.dod.internet.mgmt.mib2.host.hrStorage.hrStorageTable.
.iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageDescr
, . OID hrStorageDescr,
, , .

hrStorageDescr.1
hrStorageDescr.2
hrStorageDescr.3
hrStorageDescr.4

A:\
C:\ Label: Serial Number 445c03ba
D:\
Virtual Memory

, 1 - , 2 3 - ,
C:\ - D:\ - CD-ROM. 4, ,
.
OID hrStorageAllocationUnits,
.

hrStorageAllocationUnits.1
hrStorageAllocationUnits.2
hrStorageAllocationUnits.3
hrStorageAllocationUnits.4

0
2048
0
65536

,
C:\ 2048 , 65536 .
, OID
hrStorageSize.

hrStorageSize.1
hrStorageSize.2
hrStorageSize.3
hrStorageSize.4

0
1044209
0
4859

, , . ,

C:\ , hrStorageAllocationUnits.2 hrStorageSize.2


, .
318439424 .
, . , ,
hrStorageUsed.

hrStorageUsed.1
hrStorageUsed.2
hrStorageUsed.3
hrStorageUsed.4

0
418859
0
0

,
. ,
. , , , . ,
C:\ 80% 90% .
835367 938788 . Nagios
.
, ,
. :
.iso.org.dod.internet.private.enterprises.microsoft.software.systems.os.windowsNT.performance.
pagefilepaging-FileTable.pagefilepaging-FileEntry.pagefilePercentUsage
! OID .
.
, .
. , ,
, . ,
, MIB , .
Windows, FreeBSD. SNMP
Nagios check_snmp. , ,
net-snmp, SNMP.
ucd-snmp.
ucd-snmp, net-snmp.

. , net-snmp,
http://net-snmp.sourceforge.net/. 5.0.8.
.
# tar zxvf net-snmp-5.0.8.tar.gz

, configure, ,
.
# ./configure
Defaul version

of SNMP to use (3): 3

# SNMP,

# .
# 1, 2c, 3. , , .
System contact infomation

root@: tigrisha@sysadmins.ru

# , SNMP. .
System Location (Unknown): home
# . ,
# .
Location to write log file /var/log/snmpd.log:

/var/log/snmpd.log

# snmpd
Location to write persistent information

/var/net/snmp:

/var/net/snmp

# SNMP

, configure , .
# make

, umask ,
.
# umask 022
# make install

/usr/local/bin/.
, .
/usr/local/bin SNMP:
snmpbulkget
snmpbulkwalk
snmpcheck
snmpconf
snmpdelta
snmpdf
snmpget

snmpget.old
snmpgetnext
snmpinform
snmpnetstat
snmpset
snmpstatus
snmptable
snmptest
snmptranslate
snmptrap
snmpusm
snmpvacm
snmpwalk

, -
. Net-snmp, ucd-snmp, ,
FreeBSD. , FreeBSD 4.7,
, 4- ,
. Net.
, .
,
net-snmp 5.0.3_2 ucd-snmp 4.2.5_2. ,
.
. , ,
.
,
.
SNMP. , ,
FreeBSD SNMP . ,
, .
, , snmpd.
/usr/local/etc/rc.d/snmpd.sh,
.
# /usr/local/etc/rc.d/snmpd.sh stop
# chmod

ugo-x /usr/local/etc/rc.d/snmpd.sh

, : Nagios nagios-plugins.
1.3.0 - beta 3. ,
, check_snmp /usr/local/libexec/ .

. ,
nagios-plugins snmp. configure,
, ,
,. ucd-snmp net-snmp. ,
nagios-plugins .
nagios-plugins :
# ./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --withnagios-grp=nagios
# gmake all
# gmake install

, , .
check_snmp snmpget.
Windows
.
#/usr/local/nagios/libexec/check_snmp -H win2000rus -C QWEmn90 -o
system.sysUpTime.0
SNMP problem - No data recieved from host
CMD: /usr/local/bin/snmpget -m ALL -v 1 -c
system.sysUpTime.0

QWEmn90

win2000rus

, , .
, . ,
check_snmp. check_snmp
snmpget, .
-v 1
# . Windows 1 2c. 2 ,
# 1 .
-m ALL
# MIB
-c QWEmn90
# , . .
win2000rus
# IP , .
OID
# , .
, snmpget check_snmp
Nagios. . ,
snmpget ,
SNMP.

,
.
net-snmp:
# /usr/local/bin/snmpget -v2c -m ALL -c QWEmn90 win2000rus system.sysUpTime.0
ucd-snmp:
# /usr/local/bin/snmpget -m ALL -c QWEmn90 -v2c win2000rus system.sysUpTime.0
, SNMP ,
. , snmpget
OID, SNMP4W2K SNMP4NT. ,
, .
, OID .
net-snmp:
# /usr/local/bin/snmpget -v2c -m ALL -c QWEmn90 win2000rus .1.3.6.1.4.1.311.1.1.3.1.1.2.1.3.1
ucd-snmp:
# /usr/local/bin/snmpget -m ALL -c QWEmn90 -v2c win2000rus .1.3.6.1.4.1.311.1.1.3.1.1.2.1.3.1
, , ,
. . snmpget
snmpwalk, OID. ,
.
net-snmp:
# /usr/local/bin/snmpwalk -v2c -m ALL -c QWEmn90 win2000rus .1.3.6.1.4.1.311.1.1.3.1.1.2.1.3.1
ucd-snmp:
# /usr/local/bin/snmpwalk -m ALL -c QWEmn90 -v2c win2000rus .1.3.6.1.4.1.311.1.1.3.1.1.2.1.3.1
,
check_snmp. plugins
check_snmp.c. ,
snmp_get:
/* create the command line to execute */
command_line = ssprintf
(command_line,
"%s -m ALL -v 1 %s %s %s",
PATH_TO_SNMPGET, server_address, community, oid);

, snmp.
net-snmp:

/* create the command line to execute */


command_line = ssprintf
(command_line,
"%s -v2c -m ALL -c %s %s %s",
"/usr/local/bin/snmpwalk",community ,server_address , oid);

ucd-snmp:
/* create the command line to execute */
command_line = ssprintf
(command_line,
"%s -m ALL -c %s -v2c %s

%s",

"/usr/local/bin/snmpwalk", community, server_address, oid);

, , .
# gmake all
# gmake install

check_snmp.

Windows . , OID
SNMP4W2K
#/usr/local/nagios/libexec/check_snmp -H win2000rus -C QWEmn90 -o .
1.3.6.1.4.1.311.1.1.3.1.1.2.1.3.1
SNMP OK - INTEGER: 12

, - .
12 , .
Nagios. checkcommands.cfg
check_snmp_oid,
.
define command{
command_name check_snmp_oid
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -o $ARG1$ -C $ARG2$ -w
$ARG3$ -c $ARG4$ -u $ARG5$ -l ""
}
, check_snmp.

$USER1$ - /usr/local/nagios/libexec/
$HOSTADDRESS$ -
$ARG1$ - OID,
$ARG2$ - SNMP$ARG1$ - OID,
$ARG3$ - ,
$ARG4$ -
$ARG5$ - , . ,

"bytes"

-l "" . ,
snmp . "SNMP OK".
, .
, , ,
win2000rus hosts.cfg, hostgroups.cfg,
. ,
.
# ,
define service{
use generic-service
host_name win2000rus
service_description SNMP Page File Usage
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 1
retry_check_interval 1
contact_groups win-admins
notification_interval 120
notification_period 24x7
notification_options c,r
# 80%, 90%
# "%", .
# ,
# .
check_command check_snmp_oid!.1.3.6.1.4.1.311.1.1.3.1.1.6.1.3!QWEmn90!80!90!%
}
# , SNMP4W2K
define service{
use generic-service
host_name win2000rus
service_description SNMP CPU Load
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 1
retry_check_interval 1
contact_groups win-admins
notification_interval 120

notification_period 24x7
notification_options c,r
check_command check_snmp_oid!.1.3.6.1.4.1.311.1.1.3.1.1.2.1.3.1!QWEmn90!80!90!%
}
# ,
# .iso.org.dod.internet.mgmt.mib2.host.hrDevice.hrProcessorTable.hrProcessorEntry.hrProcessorLoad
define service{
use generic-service
host_name win2000rus
service_description SNMP hrProcessorLoad
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 1
retry_check_interval 1
contact_groups win-admins
notification_interval 120
notification_period 24x7
notification_options c,r
check_command check_snmp_oid!.1.3.6.1.2.1.25.3.3.1.2.2!QWEmn90!80!90!%
}
#
define service{
use generic-service
host_name win2000rus
service_description SNMP Up Time
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 1
retry_check_interval 1
contact_groups win-admins
notification_interval 120
notification_period 24x7
notification_options c,r
# ,
#
# , "".
# ,
# ""
check_command check_snmp_oid!.1.3.6.1.2.1.1.3!QWEmn90!""!""!""
}
#
define service{
use generic-service
host_name win2000rus
service_description SNMP Virtual Memory usage
is_volatile 0

check_period 24x7
max_check_attempts 3
normal_check_interval 1
retry_check_interval 1
contact_groups win-admins
notification_interval 120
notification_period 24x7
notification_options c,r
check_command
# 80% ,
# 254797360 , ,
# 90% ,
# 286647030 .
# , , "bytes"
check_snmp_oid!.1.3.6.1.4.1.311.1.1.3.1.1.1.3.0!QWEmn90!254797360!286647030!bytes
}
# C:\
define service{
use generic-service
host_name win2000rus
service_description SNMP Space used on disk C:\
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 1
retry_check_interval 1
contact_groups win-admins
notification_interval 120
notification_period 24x7
notification_options c,r
# 80% # , 835367 .
# 90% .
# 938788 .
# , , "blocks"
check_command check_snmp_oid!.1.3.6.1.2.1.25.2.3.1.6.2!QWEmn90!835367!938788!blocks
}
, , Nagios
.
# /usr/local/etc/rc.d/nagios

,
Windows . , ,
.
, SNMP4W2K
, Windows,
. , , , ,
, SNMP.

Вам также может понравиться