Config - srx

HOME > CONFIG > SRX

typesrxを設定するとxSSHはJuniper SRX機器へログインするものと認識しモードを切り替えながらコマンドを送信できるようになります。

「シェルモード」に切り替えてコマンドを送信したい場合はshell、「オペレーションモード」に切り替えてコマンドを送信したい場合はoperation、「コンフィグレーションモード」に切り替えてコマンドを送信したい場合configurationを設定します。

{
    "targets": [
        {
            "type": "srx",
            "host": "HOSTNAME",
            "auth_method": "password",
            "user": "USER",
            "password": "PASSWORD",
            "srx": {
                "shell": {
                    "command": ["COMMAND-1", "COMMAND-2", "COMMAND-3"],
                    "file": ["/PATH/TO/FILE-1", "/PATH/TO/FILE-2", "PATH/TO/FILE-3"]
                },
                "operation": {
                    "command": ["COMMAND-1", "COMMAND-2", "COMMAND-3"],
                    "file": ["/PATH/TO/FILE-1", "/PATH/TO/FILE-2", "PATH/TO/FILE-3"]
                },
                "configuration": {
                    "command": ["COMMAND-1", "COMMAND-2", "COMMAND-3"],
                    "file": ["/PATH/TO/FILE-1", "/PATH/TO/FILE-2", "PATH/TO/FILE-3"]
                }
            }
        }
    ]
}

targetsは配列のため複数の接続先を指定したい場合は次のように設定します。

{
    "targets": [
        {
            "type": "srx",
            "host": "HOSTNAME",
            "auth_method": "password",
            "user": "USER",
            "password": "PASSWORD",
            "srx": {
                "shell": {
                    "command": ["COMMAND-1", "COMMAND-2", "COMMAND-3"],
                    "file": ["/PATH/TO/FILE-1", "/PATH/TO/FILE-2", "PATH/TO/FILE-3"]
                },
                "operation": {
                    "command": ["COMMAND-1", "COMMAND-2", "COMMAND-3"],
                    "file": ["/PATH/TO/FILE-1", "/PATH/TO/FILE-2", "PATH/TO/FILE-3"]
                },
                "configuration": {
                    "command": ["COMMAND-1", "COMMAND-2", "COMMAND-3"],
                    "file": ["/PATH/TO/FILE-1", "/PATH/TO/FILE-2", "PATH/TO/FILE-3"]
                }
            }
        },
        {
            "type": "srx",
            "host": "HOSTNAME",
            "auth_method": "password",
            "user": "USER",
            "password": "PASSWORD",
            "srx": {
                "shell": {
                    "command": ["COMMAND-1", "COMMAND-2", "COMMAND-3"],
                    "file": ["/PATH/TO/FILE-1", "/PATH/TO/FILE-2", "PATH/TO/FILE-3"]
                },
                "operation": {
                    "command": ["COMMAND-1", "COMMAND-2", "COMMAND-3"],
                    "file": ["/PATH/TO/FILE-1", "/PATH/TO/FILE-2", "PATH/TO/FILE-3"]
                },
                "configuration": {
                    "command": ["COMMAND-1", "COMMAND-2", "COMMAND-3"],
                    "file": ["/PATH/TO/FILE-1", "/PATH/TO/FILE-2", "PATH/TO/FILE-3"]
                }
            }
        }
    ]
}