ContributionsMost RecentMost LikesSolutionsRe: Monitoring Gateway SIP Trunk Status via SSH through Command line After of changing this i am getting IO Exceptional Java Error Re: Monitoring Gateway SIP Trunk Status via SSH through Command line I tried this, I am getting an error " Connection Refused Connect" Re: Monitoring Gateway SIP Trunk Status via SSH through Command line Mike Moniz, Can you suggest how to achieve this? Re: Monitoring Gateway SIP Trunk Status via SSH through Command line I have attached the snapshot for reference , please let me know any other info Re: Monitoring Gateway SIP Trunk Status via SSH through Command line Model - ISR4431/K9 Router firmware_version 17.6.1 hardware_version V07 Vendor - Cisco Monitoring Gateway SIP Trunk Status via SSH through Command line Hi, I am trying to monitor the status of the Gateway SIP trunk using the command "show sip-ua register status" via SSH. However, I am encountering issues while running a custom script provide by the support team. Initially, when I ran the script a few times, I received an error: "Unable to establish the SSH Connection". After some time, the error changed to "No Signature Method." I have verified the SSH connection from the collector server to the end device, and it works fine when I manually establish the SSH session. I also tested my own script , but it returned a similar error: "Error: Unable to establish SSH session/channel." I have attached the error snapshot and the script I am using for reference. Please guide me on how to monitor the SIP status via the command line using SSH. When running the command "show sip-ua register status", the output is either Yes (registered) or No (unregistered) from the device end. In LogicMonitor, the expected output should be: Yes = 0 No = 1 I tried to attach the Script but it will not support Txt Format, Sorry for the inconvenience Below is the script Provided by the support team import com.santaba.agent.groovyapi.expect.Expect; // Get the hostname and credentials from the device property table hostname = hostProps.get("system.hostname"); userid = hostProps.get("ssh.user"); passwd = hostProps.get("ssh.pass"); // Ensure required properties are not null if (!hostname || !userid || !passwd) { throw new Exception("Missing required device properties: hostname, ssh.user, or ssh.pass."); } // Initiate an SSH connection to the host using the provided credentials def ssh_connection = Expect.open(hostname, userid, passwd); // Wait for the CLI prompt to confirm connection ssh_connection.expect("# "); // Adjust prompt based on your device // Send the `show sip-ua register status` command ssh_connection.send("show sip-ua register status\n"); // Wait for the response to complete ssh_connection.expect("#"); // Replace with your device's prompt // Print the output of the command println "Command Output: " + ssh_connection.getLastOutput(); // Logout ssh_connection.send("exit\n"); // Close the SSH connection handle ssh_connection.expectClose(); return 0; This is another script Created by Me import com.santaba.agent.groovyapi.expect.Expect // Device credentials and details def deviceIP = hostProps.get("system.ip") // IP address of the device def username = hostProps.get("ssh.user") // SSH username from LogicMonitor def password = hostProps.get("ssh.pass") // SSH password from LogicMonitor // Command to execute def command = "show sip-ua register status" // Initialize result def resultCode = 1 // Default to 1 (Unregistered) // Start SSH session try { def session = Expect.open(deviceIP, username, password) // Send the command session.send(command + "\n") // Wait for the output def output = session.expect(10, ".*") // Adjust timeout (10 seconds) as needed println("Command output: ${output}") // Check the output for 'Yes' or 'No' if (output.toLowerCase().contains("yes")) { resultCode = 0 // Registered } else if (output.toLowerCase().contains("no")) { resultCode = 1 // Unregistered } else { throw new Exception("Unexpected output: ${output}") } // Close the session session.close() } catch (Exception e) { println("Error: ${e.message}") // Optionally log additional details for debugging } // Print the result for LogicMonitor println(resultCode) return resultCode Re: Email Ingestion Hey Stuart, The JSON Format isn't the problem. We've identified the cause of the error. Earlier today, we updated the email password and successfully tested the script, yielding the expected output. However, the password is inexplicably becoming locked within moments. I'm uncertain as to why this is occurring, but it's resulting in a JSON error. If you have any insights into why the password might be getting locked, I'd appreciate your input. Re: Email Ingestion I utilized the script as an event source since it allows us to view the content of the email. Using a data source would only display the email count. While running the script in debug mode, it executed successfully and returned with code 0. However, encountering the mentioned error occurred when running the script with the event source. Could you setup a 30-minute call to discuss this further? It would help me explain the issue more effectively. Re: Email Ingestion Hello Stuart, Apologies for the delayed response; I wasn't available last week. After running the script yesterday, I encountered a JSON error that wasn't present before. Could you please advise why this error is occurring and provide guidance on how and where to rectify it? I've included a snapshot of the error for reference. Re: Email Ingestion Yes, I reached out to support again. Here's the response I received: I was never able to get this script working. This is why my suggestions are the following; Can we add this device as a resource within Logicmonitor Can we get this data from this device in a different way; i.e. snmp syslogs or traps, etc? Does this device write a log file that we could potentially monitor for this data? Another option would be to get in touch with your CSM, who can put you in touch with our professional services team to build out a datasource/eventsource for you. Another potential option may be to add a collector where that resource is and have it just poll this device like for real monitoring versus just getting email. But we can't monitor by doing SNMP Trap, Because Devices are hosted in Cloud. It is not capable of sending the SNMP traps
Top ContributionsMeraki MonitoringMonitoring Gateway SIP Trunk Status via SSH through Command lineMonitoring DAS Environment and Creating Custom Data Sources in Logic MonitorEmail IngestionCore Dump File MonitoringRe: Monitoring Gateway SIP Trunk Status via SSH through Command lineRe: Monitoring Gateway SIP Trunk Status via SSH through Command lineRe: Monitoring Gateway SIP Trunk Status via SSH through Command lineRe: Monitoring Gateway SIP Trunk Status via SSH through Command lineRe: Meraki Monitoring