Nie jesteś zalogowany.
Jeśli nie posiadasz konta, zarejestruj je już teraz! Pozwoli Ci ono w pełni korzystać z naszego serwisu. Spamerom dziękujemy!
Prosimy o pomoc dla małej Julki — przekaż 1% podatku na Fundacji Dzieciom zdazyć z Pomocą.
Więcej informacji na dug.net.pl/pomagamy/.
Witajcie, czy ktoś może pomóc mi z Nagiosem?
Zaisntalowałem Nagiosa, standardowe pluginy działają, mam problem z chceck_snmp_printer z http://exchange.nagios.org/directory/Plugins/Hardware/Printers/SNMP-Printer-Check/details
Sciągnałem plugin, skopiwałem do /usr/lib/nagios/plugins,
do etc/nagios3/commands.cfg dodałem wpis:
define command{ command_name check_snmp_printer command_line $USER1$/check_snmp_printer -H $HOSTADDRESS -C $ARG1$ -x $ARG2 -w $ARG3$ -c $ARG4$ }
Do printer.cfg dopisałem
define service{ use generic-service host_name hp1536dnf service_description Toner Supply check_command check_snmp_printer!192.168.115.70!public!CONSUM!20!10 }
Po restarcie Nagios w rekordzie Toner Suply pokazuje komunikat
WARNING: No SNMP response from -C! Make sure host is up and SNMP is configured properly
SNMP działa, konfiguracja domyślna.
# ps -aux | grep snmp Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html snmp 1790 0.0 0.1 8828 4136 ? S 09:33 0:02 /usr/sbin/snmpd -Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid root 8489 0.0 0.0 3304 752 pts/1 S+ 11:45 0:00 grep snmp
Widać, że komputer komunikuje się z drukarką:
snmpwalk -v 1 -c public 192.168.115.70
pokazuje
iso.3.6.1.2.1.1.1.0 = STRING: "HP ETHERNET MULTI-ENVIRONMENT,SN:CNB9B9BBY1,FN:P901CBZ,SVCID:20339,PID:HP LaserJet M1536dnf MFP" iso.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.11.2.3.9.1 iso.3.6.1.2.1.1.3.0 = Timeticks: (95185041) 11 days, 0:24:10.41 iso.3.6.1.2.1.1.4.0 = "" iso.3.6.1.2.1.1.5.0 = STRING: "NPI403877" iso.3.6.1.2.1.1.6.0 = "" iso.3.6.1.2.1.1.7.0 = INTEGER: 72 iso.3.6.1.2.1.1.8.0 = Timeticks: (0) 0:00:00.00 iso.3.6.1.2.1.1.9.1.2.1 = OID: iso.3.6.1.6.3.1 iso.3.6.1.2.1.1.9.1.2.2 = OID: iso.3.6.1.6.3.10.3.1.1 iso.3.6.1.2.1.1.9.1.2.3 = OID: iso.3.6.1.6.3.11.3.1.1 iso.3.6.1.2.1.1.9.1.2.4 = OID: iso.3.6.1.6.3.15.2.1.1 iso.3.6.1.2.1.1.9.1.2.5 = OID: iso.3.6.1.6.3.16.2.1.1 iso.3.6.1.2.1.1.9.1.3.1 = STRING: "The MIB Module from SNMPv2 entities" iso.3.6.1.2.1.1.9.1.3.2 = STRING: "SNMP Management Architecture MIB" iso.3.6.1.2.1.1.9.1.3.3 = STRING: "Message Processing and Dispatching MIB" iso.3.6.1.2.1.1.9.1.3.4 = STRING: "USM User MIB" iso.3.6.1.2.1.1.9.1.3.5 = STRING: "VACM MIB" iso.3.6.1.2.1.1.9.1.4.1 = Timeticks: (0) 0:00:00.00 iso.3.6.1.2.1.1.9.1.4.2 = Timeticks: (0) 0:00:00.00 iso.3.6.1.2.1.1.9.1.4.3 = Timeticks: (0) 0:00:00.00 iso.3.6.1.2.1.1.9.1.4.4 = Timeticks: (0) 0:00:00.00 iso.3.6.1.2.1.1.9.1.4.5 = Timeticks: (0) 0:00:00.00 iso.3.6.1.2.1.2.1.0 = INTEGER: 2 iso.3.6.1.2.1.2.2.1.1.1 = INTEGER: 1 iso.3.6.1.2.1.2.2.1.1.2 = INTEGER: 2 iso.3.6.1.2.1.2.2.1.2.1 = STRING: "LOOPBACK" iso.3.6.1.2.1.2.2.1.2.2 = STRING: "Ethernet" iso.3.6.1.2.1.2.2.1.3.1 = INTEGER: 24 iso.3.6.1.2.1.2.2.1.3.2 = INTEGER: 6 iso.3.6.1.2.1.2.2.1.4.1 = INTEGER: 1500 iso.3.6.1.2.1.2.2.1.4.2 = INTEGER: 1500 iso.3.6.1.2.1.2.2.1.5.1 = Gauge32: 0 iso.3.6.1.2.1.2.2.1.5.2 = Gauge32: 10000000 iso.3.6.1.2.1.2.2.1.6.1 = "" iso.3.6.1.2.1.2.2.1.6.2 = Hex-STRING: D4 85 64 40 38 77 iso.3.6.1.2.1.2.2.1.7.1 = INTEGER: 1 iso.3.6.1.2.1.2.2.1.7.2 = INTEGER: 1 iso.3.6.1.2.1.2.2.1.8.1 = INTEGER: 1 iso.3.6.1.2.1.2.2.1.8.2 = INTEGER: 1 iso.3.6.1.2.1.2.2.1.9.1 = Timeticks: (0) 0:00:00.00 iso.3.6.1.2.1.2.2.1.9.2 = Timeticks: (33925624) 3 days, 22:14:16.24 iso.3.6.1.2.1.2.2.1.10.1 = Counter32: 354848503 iso.3.6.1.2.1.2.2.1.10.2 = Counter32: 244041036 iso.3.6.1.2.1.2.2.1.11.1 = Counter32: 3950161 iso.3.6.1.2.1.2.2.1.11.2 = Counter32: 355579 iso.3.6.1.2.1.2.2.1.12.1 = Counter32: 0 iso.3.6.1.2.1.2.2.1.12.2 = Counter32: 323702 iso.3.6.1.2.1.2.2.1.13.1 = Counter32: 0 iso.3.6.1.2.1.2.2.1.13.2 = Counter32: 0 iso.3.6.1.2.1.2.2.1.14.1 = Counter32: 0 iso.3.6.1.2.1.2.2.1.14.2 = Counter32: 0 iso.3.6.1.2.1.2.2.1.15.1 = Counter32: 0
i wiele więcej...
Ktoś coś poradzi?
Offline
Problem rozwiązany.
W pliku commands.cfg ustawiłem na "sztywno" wszystkie parametry
#define command{ command_name check_printer command_line $USER1$/check_snmp_printer -H $HOSTADDRESS -C $ARG1$ -#x #$ARG2 -w $ARG3$ -c $ARG4$ }
zmieniełem na:
define command { command_name check_printer command_line ./$USER1$/check_snmp_printer -H 192.168.115.70 -C public -x "CONSUM ALL" -w 50 -c 20 }
Może mało elegancko, ale działa.
Offline
[b]pieniek88[/b] Czy możesz mi pomóc? Zrobiłem dokładnie jak Ty, czyli ściągnąłem z tej strony plugin nagiosa oraz w commands.cfg i w print.cfg wkleiłem odpowiednio:
define command{ command_name check_snmp_printer command_line $USER1$/check_snmp_printer -H $HOSTADDRESS -C $ARG1$ -x $ARG2 -w $ARG3$ -c $ARG4$ }
define service{ use generic-service host_name hp1536dnf service_description Toner Supply check_command check_snmp_printer!192.168.115.70!public!CONSUM!20!10 }
ale wywala mi jakieś błędy:
./check_snmp_printer: line 701: `binaries="snmpwalk snmpget bc egrep xxd" for required_binary in $binaries; do'
i nagios nie może się zrestartować. Nawet z 'palca' nie chce ten skrypt zadziałać.
Może wiesz jak naprawić ten problem lub może masz inny pomysł jak monitorować toner w drukarce?
Offline
^Google pokazuje, że problem rozwiązany
Ostatnio edytowany przez pieniek88 (2011-12-08 10:31:48)
Offline
Time (s) | Query |
---|---|
0.00014 | SET CHARSET latin2 |
0.00006 | SET NAMES latin2 |
0.00220 | SELECT u.*, g.*, o.logged FROM punbb_users AS u INNER JOIN punbb_groups AS g ON u.group_id=g.g_id LEFT JOIN punbb_online AS o ON o.ident='3.147.69.64' WHERE u.id=1 |
0.00081 | REPLACE INTO punbb_online (user_id, ident, logged) VALUES(1, '3.147.69.64', 1731650390) |
0.00082 | SELECT * FROM punbb_online WHERE logged<1731650090 |
0.00088 | SELECT topic_id FROM punbb_posts WHERE id=187217 |
0.00555 | SELECT id FROM punbb_posts WHERE topic_id=20057 ORDER BY posted |
0.00091 | SELECT t.subject, t.closed, t.num_replies, t.sticky, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, 0 FROM punbb_topics AS t INNER JOIN punbb_forums AS f ON f.id=t.forum_id LEFT JOIN punbb_forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id=20057 AND t.moved_to IS NULL |
0.00012 | SELECT search_for, replace_with FROM punbb_censoring |
0.00121 | SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM punbb_posts AS p INNER JOIN punbb_users AS u ON u.id=p.poster_id INNER JOIN punbb_groups AS g ON g.g_id=u.group_id LEFT JOIN punbb_online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id=20057 ORDER BY p.id LIMIT 0,25 |
0.00363 | UPDATE punbb_topics SET num_views=num_views+1 WHERE id=20057 |
Total query time: 0.01633 s |