Submit a ticketCall us

Training ClassSign up for Network Performance Monitor (NPM) and Scalability instructor-led classes

Attend our instructor-led classes, provided by SolarWinds® Academy, to discuss the more advanced monitoring mechanisms available in NPM as well as how to tune your equipment to optimize its polling capabilities. NPM classes offered:
NPM Custom Monitoring and Polling
Orion Platform Scalability

Reserve your seat.

Home > Success Center > Server & Application Monitor (SAM) > SAM - Knowledgebase Articles > Python Examples for Unix or Linux monitor on Linux

Python Examples for Unix or Linux monitor on Linux

Table of contents

Updated August 1, 2018

Overview

Here are sample Python scripts. These are running on SAM 6.6.1.

Environment

  • All versions of SAM

Detail

1.  Here is an example of a Python script that returns constants:

 

print ("Statistic.Stat1: 1");

print ("Message.Stat1: Hello World");

 

=======================================

Output Result:

Statistic.Stat1:   1

Message.Stat1:  Hello World

 

2.  Here is an example of a Python script that will print the value of a variable (the variable, value, is an integer):

 

#!/usr/bin/python

 

import sys

value = 20

 

print "Statistic.Stat1:  %d" % value

print "Message.Stat1: hello World"

sys.exit(0)

 

========================================  

Output Result:

Statistic.Stat1:    20

Message.Stat1:  hello World

 

 

Last modified

Tags

Classifications

Public