Tomsk Sysadmins Forum
Оборудование => Cisco => Topic started by: boombastic on May 28, 2007, 13:00:28
-
Решил вот покопаться в встроенном kron
(http://cisco.com/en/US/products/sw/iosswrel/ps5187/products_feature_guide09186a00801b0695.html)
вместо связки crond+snmp
Нарисовал тестовый policy-list
kron policy-list DAILY-WAN-POLICY
cli configure terminal
cli policy-map WAN-POLICY
cli class MY-TRAFFIC
cli police 64000 conform-action transmit exceed-action drop
cli end
exit
kron occurrence DAILY-TEST in 2 oneshot
debug kron all
вижу
000108: May 28 12:50:31.963 NSKS: Major 1, Minor 0
000109: May 28 12:50:31.963 NSKS: Timer Event DAILY-TEST
000110: May 28 12:50:31.963 NSKS: Call parse_cmd 'configure terminal'
000111: May 28 12:50:31.967 NSKS: Kron CLI return 0
'
**CLI 'configure terminal':
Enter configuration commands, one per line. End with CNTL/Z.'
000112: May 28 12:50:31.975 NSKS: Major 4, Minor 7
000113: May 28 12:50:31.975 NSKS: Respond to end of CLI Process
000114: May 28 12:50:31.995 NSKS: Call parse_cmd 'policy-map WAN-POLICY'
000115: May 28 12:50:32.003 NSKS: Kron CLI return 2
''
000116: May 28 12:50:32.003 NSKS: Major 4, Minor 7
000117: May 28 12:50:32.003 NSKS: Respond to end of CLI Process
000118: May 28 12:50:32.007 NSKS: Call parse_cmd 'class MY-TRAFFIC'
000119: May 28 12:50:32.007 NSKS: Kron CLI return 2
''
000120: May 28 12:50:32.007 NSKS: Major 4, Minor 7
000121: May 28 12:50:32.011 NSKS: Respond to end of CLI Process
000122: May 28 12:50:32.015 NSKS: Call parse_cmd 'police 64000 conform-action transmit exceed-action drop'
000123: May 28 12:50:32.015 NSKS: Kron CLI return 2
''
000124: May 28 12:50:32.015 NSKS: Major 4, Minor 7
000125: May 28 12:50:32.015 NSKS: Respond to end of CLI Process
000126: May 28 12:50:32.019 NSKS: Call parse_cmd 'end'
000127: May 28 12:50:32.023 NSKS: Kron CLI return 2
''
000128: May 28 12:50:32.023 NSKS: Major 4, Minor 7
000129: May 28 12:50:32.023 NSKS: Respond to end of CLI Process
000130: May 28 12:50:32.023 NSKS: Forcing Removing Occur DAILY-TEST
000131: May 28 12:50:32.023 NSKS: Removing Occur DAILY-TEST
000132: May 28 12:50:32.023 NSKS: Removing Policy Name 'DAILY-WAN-POLICY'
000133: May 28 12:50:32.023 NSKS: Finished Removing Occurrence DAILY-TEST
В итоге он понял только configure terminal а всё остальное не выполнилось.
Хотя ручное выполнение этих же команд даёт 100% результат.
Вопрос. kron пока не научился выполнять команды из configure mode? или я где то ошибся?
Гугль + forums.cisco.com молчат
-
В итоге он понял только configure terminal а всё остальное не выполнилось.
Хотя ручное выполнение этих же команд даёт 100% результат.
Вопрос. kron пока не научился выполнять команды из configure mode? или я где то ошибся?
Гугль + forums.cisco.com молчат
Know your limitations
Another thing to look out for is that kron has more limitations than its Windows or UNIX counterparts. For example, you can only use privileged-mode commands with kron; it doesn't allow any Global or Interface configuration commands. This is because it executes each command separately.
In addition, it doesn't allow you to edit the list of commands once you've entered them. Therefore, you should test the command sequence before entering it. If a command in the sequence fails, the router will delete that sequence of commands and not run it again.
Some of these limitations may be due to the fact that the command scheduler's primary design appears to be to allow Cisco routers to contact Cisco's CNS server to request an automatic upgrade. While this is a good use for the command scheduler, you can also use it for a number of other handy tasks.
http://articles.techrepublic.com.com/5100-...11-5553313.html (http://articles.techrepublic.com.com/5100-1035_11-5553313.html)