Here is the deal. I want to use perl to ping a server and need to get the address from a flat file that has a fix file format. The field that I'm tring to get is the second column in the file. Any Perl experts that could help me get  this thing working on my box. The grep4=ntharg(entry,2,\":\");\ returns the the second field but I can't get ping to use the  the grep4. 







APPLICATIONS = { 
  { NAME = "ROUTERS",
	ACTIVE = True,
	SECURITY = False,
	PROPAGATE_STATE = True,
	CREATE_ICON = True,
	SUSPEND_GLOBAL_PARAMS = False,
	SHOWINST = False,
	DISCOVERY_TIME = 60,
	DISCOVERY = PSL,
	PRE_DISCOVERY_TEXT =  922285734 "#unix_only.psl\


PslDebug = 0;\
\
# if the config file doesn't exist, continue with pre-discovery only\
#\
if (file(get(\"/patrolHome\").\"/lib/local_alerts/network.config\")) {\
	set(\"active\",2);\
	}\
else {\
	set(\"active\",1);\
	}",
	DISCOVERY_TEXT =  955039061 "#\
DEBUG=0;\
#\
icons = get(\"/ROUTERS/instances\");\
foreach y (icons)\
{\
   set(\"/ROUTERS/\".y.\"/online\",0);\
}\
#\
#\
infile = cat(get(\"/patrolHome\").\"/lib/local_alerts/network.config\");\
#\
#\
foreach entry (infile) {\
	label=ntharg(entry,1,\":\");\
	grep4=ntharg(entry,2,\":\");\
	num_needed=ntharg(entry,3,\":\");\
	if (!exists(\"/ROUTERS/\".label)) {\
		create(label.\"-Master\",label,OK);\
	}\
	set(\"/ROUTERS/\".label.\"-Master/online\",1);\
	foreach proc (process(grep4)) {\
		cnt++;\
#		pid = ntharg(proc,1);\
#		set(\"/ROUTERS/\".pid.\"/online\",1);\
#		if (!exists(pid)) {\
#			create(pid,label.\"-\".pid,OK);\
#			# turn off the alarm parameter for this instance\
#			# - only need to see it for Master instances\
#			set(\"/ROUTERS/\".pid.\"/PROProcAlarm/active\",0);\
#		}\
	}\
if (DEBUG) { print(\"\\nPID= \".pid); }\
set(\"/ROUTERS/\".label.\"-Master/num_needed\",num_needed);\
set(\"/ROUTERS/\".label.\"-Master/num_now\",cnt);\
if ( cnt < num_needed) {\
	set(\"/ROUTERS/\".label.\"-Master/PROProcAlarm/value\",1);\
}\
else {\
	set(\"/ROUTERS/\".label.\"-Master/PROProcAlarm/value\",0);\
}\
cnt=0;\
}\
#\
#  Remove instances that no longer exist\
#\
foreach z (icons)\
{\
   if( ! get(\"/ROUTERS/\".z.\"/online\") )\
   {\
      destroy(z);\
   }\
}\
",
	OK_PICTURE = "process_ok.xpm",
	WRONG_PICTURE = "process_warn.xpm",
	PARAMETERS = {
		{	NAME = "PROProcAlarm", PARAM_TYPE = CONSUMER, ACTIVE = True, MONITOR = True, CHECK = False,
				BASE_COMMAND = { 
				{ COMPUTER_TYPE = "ALL_COMPUTERS", COMMAND_TYPE = "OS",
				  COMMAND_TEXT =  845406750 "exit;"}
				},
			TITLE = "ProcessAlarm",
			HISTORY_TIME = "", HISTORY_SPAN = 16, HISTORY_LEVEL = False,
			FORMAT = "%f", OUTPUT = OUTPUT_STATEBOOLEAN,
			AUTO_RESCALE = False, Y_AXIS_MIN = 0, Y_AXIS_MAX = 1,
			RANGES = {
			  { NAME = "BORDER", ACTIVE = False, MINIMUM = 0, MAXIMUM = 0, STATE = OK, ALARM_WHEN = ALARM_INSTANT, ALARM_WHEN_N = 0
			  },
			  { NAME = "ALARM1", ACTIVE = False, MINIMUM = 0, MAXIMUM = 0, STATE = OK, ALARM_WHEN = ALARM_INSTANT, ALARM_WHEN_N = 0
			  },
			  { NAME = "ALARM2", ACTIVE = True, MINIMUM = 1, MAXIMUM = 1, STATE = ALARM, ALARM_WHEN = ALARM_INSTANT, ALARM_WHEN_N = 0
			  }
			}
		}

	}
  }
}
!30551