Reply
Accepted Solution

Setting the job status within a Perl script

Authority
Posts: 40
1843     0

Hi, 

Not sure if this has been asked, or is possible, but I am writing a Perl script to do a number of tasks on a Cisco switch. 

 

However I want the job to fail if certain conditions are/are not met within the script.

So I am using an integer variable, "vlan_id". I want the job to fail if the vlan_id is not valid for any reason.

 

That was one example. 

 

Is there any perl snippet that will be able to set the job status to fail. 
Guess the 1st thing would be to find out the job number though.

This is running internally within NetMRI and not as an external API call.

 

 

Thanks

 

Russ

Re: Setting the job status within a Perl script

Adviser
Posts: 353
1843     0
If it’s an internally running job, I believe if you just exit with non-zero status it will be considered an error and flag that job (for that device) as an error. (I didn’t try this).

Re: Setting the job status within a Perl script

Authority
Posts: 40
1843     0

 Hi John,

Works perfectly. Thanks for the quick reply

Set the exit 1 on each of my conditions.

 

Many thanks 

 

Russ

Highlighted

Re: Setting the job status within a Perl script

Authority
Posts: 40
1843     0

Hi, You answered this some time ago and this works and flags a Red symbol with an X.

Is there anyway of exiting with a warning. e.g. Yellow triangle. Again it is an internal job.

 

Thanks in advance

 

Russ

Showing results for 
Search instead for 
Do you mean 

Recommended for You