Learn How We Can Help You Keep Teleworkers Protected During the COVID-19 Crisis

Network Change & Configuration Management

Reply
Highlighted

Script for triggering a custom issue

Techie
Posts: 3
2217     0

I have created a custom issue with an id of "JUNOS_Alarms". The idea is to have a script scheduled to run daily against Juniper devices that uses the output of a "show system alarm" command to determine if there are active alarms, then trigger the custom issue passing the device name and alarm text. I first tried CCS because I haven't used it yet and thought I should try it out. However, I kept getting "invalid line" errors every time I tried to save it. I got them for "Script_Schedule", "Device-Groups", "Trigger-Description", "Trigger-Variables" and then gave up. I am going to attach that script and would appreciate it if someone could tell me what I am doing wrong. I used the "Catalyst 3750 Bad Stack Switch" script as my guide. As a test I copied that script and uncommented the "Script-Schedule" line and that wouldn't save either - gave me an invalid line error again. The fact that the sample script won't save seems to indicate the scripting environment has changed.Then I wrote the script in PERL - much easier. But when I ran it I got the following error:*** Error / NetMRI::API error loading NetMRI::API::Broker::V2_5_0::IssueAdhocs: no such class at /mnt/host/lib/NetMRI_Easy.pm line 1042So I committed a cardinal sin and edited the EZ module and deleted that trailing 's' in IssueAdhocs. Then it ran fine. The job status was 'ok' and it returned an issue id to my log. However, when I checked out the device there was no issue listed. I feel I am close, at least in PERL. Can anyone tell me what I am still missing?

Highlighted

Re: Script for triggering a

Expert
Posts: 127
2218     0
As far as the CCS script goes, If you look up in the table of contents (TOC) of the help - CCS Script Attributes, in the table at the top of the page it indicates that the Script-Schedule, Script-Groups, etc. are only in the table for reference and will generate an error if entered into a script.Line 22, "Triggers:" is not correct. Drop the "s", should read "Trigger:" That should also fix the "Trigger-Description:"Hope that helps.-Lon.
Showing results for 
Search instead for 
Do you mean 

Recommended for You