In your original script, the problem is the space after the "=".
Without that space, the shell parses that as a simple variable assignment (whose value is the result of the command substitution). With that space, the result of the command substitution is treated as a command to execute (with NUM/partition in its environment and set to a zero-length string).
I am trying to do a shell script to check a folder and see if files are passing through.
Now if a file did not pass through in the last 1 hour send an email.
ftp----------> folder to monitor ----------->ftp
Now the script that moves the file runs every sec in cron, so i do not know if i... (0 Replies)
Does anyone have a monitoring script in solaris that monitors the drives in an exclosure? The script should be in /bin/bash or /bin/sh thnks again
This should be for solaris 10/11 looking for something that tells me a drive is down or offline.:confused: (0 Replies)
Hi All,
I want a scrip to monitor values which is the out put of a certain command. Example is
$ for (( c=1; c<15; c++ )); do cmu -O HTA -d HTTP-PROXY.tswebpxmp5.$c | grep -i active; done
HTA_STATS_htaStatsDef.ifw_stats.streamStat.activeStreams : 2
... (1 Reply)
Hi All,
In a script I would like to check whether the current running command is completed in 1 hour or not. This i want to achieve inside the same script. I don't want to use separate script to monitor my current running script.
eg.
pseudocode;
Command1
if command1>60 mins
then... (7 Replies)
HIi Guys... I am in a fix.... 1st the code :
Script 123.sh looks like this :
./abc # a script which is getting called in this script
while true
do
count=`ps -ef | grep abc | wc -l`
if
echo "abc is running
sleep 10
fi
done
but the process is getting checked... (5 Replies)
Hello friends, as they are? First of all sorry for my poor English. I tell them what is my problem. I have the following script, which is basically what makes error search for a pattern within a folder containing logs. The script works fine, the problem is that whenever I find a pattern of new... (2 Replies)
I developed for monitoring the network connections among the branch servers as I given below as script.But I don't know how to monitor the services through network script whether the services is running or not. eg : I want to check the postgres service for all the branch servers through network... (0 Replies)
Sorry if this is the wrong forum
Searching for Saas Monitor service which monitor my servers which are sitting in different providers .
This monitor tool will take as less CPU as possible , and will send info about the server to main Dashboard.
The info I need is CPU / RAM / my servers status (... (1 Reply)
Hi all,
on our application server we have the following script that monitor the status of the website, my problem here is that i have edite the retries from 3 to 5,
and the timewait to 120 second,
so the script should check 5 times every 2 minutes, and if the fifth check fails it must restart... (0 Replies)
Discussion started by: charli1
0 Replies
LEARN ABOUT PHP
mssql_field_seek
MSSQL_FIELD_SEEK(3)MSSQL_FIELD_SEEK(3)mssql_field_seek - Seeks to the specified field offsetSYNOPSIS
bool mssql_field_seek (resource $result, int $field_offset)
DESCRIPTION
Seeks to the specified field offset. If the next call to mssql_fetch_field(3) won't include a field offset, this field would be returned.
PARAMETERS
o $result
- The result resource that is being evaluated. This result comes from a call to mssql_query(3).
o $field_offset
- The field offset, starts at 0.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
Using mssql_field_seek(3) on the example for mssql_fetch_field(3)
<?php
// Connect to MSSQL and select the database
mssql_connect('MANGOSQLEXPRESS', 'sa', 'phpfi');
mssql_select_db('php');
// Send a select query to MSSQL
$query = mssql_query('SELECT * FROM [php].[dbo].[persons]');
// Construct table
echo '<h3>Table structure for 'persons'</h3>';
echo '<table border="1">';
// Table header
echo '<thead>';
echo '<tr>';
echo '<td>Field name</td>';
echo '<td>Data type</td>';
echo '<td>Max length</td>';
echo '</tr>';
echo '</thead>';
// Dump all fields
echo '<tbody>';
for ($i = 0; $i < mssql_num_fields($query); ++$i) {
// Fetch the field information, notice the
// field_offset parameter is not set. See
// the mssql_field_seek call below
$field = mssql_fetch_field($query);
// Print the row
echo '<tr>';
echo '<td>' . $field->name . '</td>';
echo '<td>' . strtoupper($field->type) . '</td>';
echo '<td>' . $field->max_length . '</td>';
echo '</tr>';
// Move the internal seek pointer to the next
// row in the result set
mssql_field_seek($query, $i + 1);
}
echo '</tbody>';
echo '</table>';
// Free the query result
mssql_free_result($query);
?>
SEE ALSO mssql_fetch_field(3).
PHP Documentation Group MSSQL_FIELD_SEEK(3)