Gathering usage statistics

so i have a script that runs across many servers. i'd like to know how many times this script is being used on each server.

the only straight forward, non-intrusive way i can think of doing this is to include a line in the script to make a webcall to a central server. and from that central server, i can count how many times each server is running the script.

i have the following basic code that i'm looking into:

echo -e "HTTP" | nc <ip-of-central-server> 80

Only problem with this is, i'm not sure if "nc" is installed by default on most unix systems.

if it isn't, is there an alternative to it?

Or, is there another straight-forward, and simplistic way to make an external call to a central server?

Build something with ssh?

How about a log file (or files) on a shared NFS volume?

..... or syslog messages being routed to a central place?

Probably plenty more options too. I'd probably shy away from a single log file on an NFS server because of competing updates. You could have a shared directory and a log file for each server though.

Robin

1 Like

You didn't mention the shell version you use. Recent shells (e.g. bash , ksh ) offer redirection to a remote port:

2 Likes

these servers are remote and i do not have any type of privileged access on them. i cant use nfs. the only way is through something similar to a web call.

Can you have the script send an email to the central server?

logger -h host -P port . Have these options existed always ?

Juha

1 Like

If automounter service is running, you can perhaps access an NFSserver/volume as /net/nfsserver/export/path

1 Like

By "web call" you you mean HTTP? Why not use wget, or curl?