Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
SM SQL Command line power shell - how to integrate with Perl?
2011-07-26
12:58 PM
3,652 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I want to write a perl script to scrape the get-backup output to report on basic backup information. (No I don't want to use the GUI for lots of reasons).
How do you interface with the Power Shell from a DOS prompt? If I can run the commands from a DOS prompt I can run the commands with Perl.
What I'm ultimately trying to do is gather information about the backups, send an SNMP trap to our monitoring system if it fails and upload the information to a centralized reporting database.
Thanks in advance.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Answering my own question.
c:\Program Files\NetApp\SnapManager for SQL Server>C:\Windows\System32\WindowsPo
werShell\v1.0\powershell.exe -psconsolefile "c:\program files\netapp\snapmanager
for sql server\SmsqlShell.psc1" -command get-backup -server <SERVER> -INST <INSTANCE>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is correct.
-Abhishek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi ,
SnapManager 5.1 supports the new SnapManager command-line functionality called cmdlet, through SnapManager PowerShell.
This SnapManager commandline interface enables you to execute the following operations:
◆ new-backup
◆ verify-backup
◆ restore-backup
◆ get-backup
◆ delete-backup
◆ clone-database
◆ clone-backup
◆ delete-clone
◆ import-config
◆ export-config
Also make sure to Enter the command get-executionpolicy in PowerShell.
If the policy displayed is “Allsigned” or “Restricted”, enter any of the following commands:
set-executionpolicy unrestricted
or
set-executionpolicy remotesigned
Add-PSSnapin NetApp.SnapManager.SQL.PS.Admin -ErrorAction silentlycontinue can be specified in the script.
Regards,
Abhishek
