Dietmar,
The LANG setting was the issue. Doing the export worked fine. Thanks.
Mahesh
>>> DIETMAR_GAULHOFER@at.ibm.com 01/03/03 08:00AM >>>
Hi,
i had once a problem with running scripts via cron on linux , that the LANG
variable was not set - there is no default LANG in cron as far i have
seen. On AIX you have it in /etc/environment defined , on Linux i have no
idea - so i addedt a "export LANG="..." to the script ....
maybe that helps.
Mahesh Tailor <mahesh.tailor@network.carilion.com>@lists.us.ibm.com on
10.10.2003 18:00:56
Please respond to nv-l@lists.us.ibm.com
Sent by: owner-nv-l-digest@lists.us.ibm.com
To: nv-l@lists.us.ibm.com
cc:
Subject: [nv-l] NV on Linux
Hello, all!
This might a bit off subject, but someone might be able to help.
NV: 7.1.3 FP1
OS: RedHat Linux Enterprise AS
I have a script (/tmp/t.sh) with the following contents:
#!/bin/ksh
/usr/OV/bin/snmpColDump -t /usr/OV/databases/snmpCollect/ifInOctets.1 >
/tmp/t.out
When I execute this file from the root prompt, /tmp/t.out contains the
following:
10/09/2003 10:55:52 AM myrouter.net.carilion.com 125.858 1065711352
10/09/2003 10:55:52 AM myrouter.net.carilion.com 26968.6 1065711352
I then add the following to root's crontab:
54 08 * * * /tmp/t.sh 1>/dev/null 2>&1
When this cronjob is executed, /tmp/t.out contains the following:
10/09/2003 10:55:52 myrouter.net.carilion.com 125.858 1065711352
10/09/2003 10:55:52 myrouter.net.carilion.com 26968.6 1065711352
As you can see the AM/PM indicator is missing.
I have tried with #!/bin/ksh, #!/bin/bash. #!/myshell/ksh [this is the
ksh for Linux available from David Korn's website], and #!/bin/sh, with
the same results.
Also, running the snmpColDump directly from the root prompt, gives the
same output with the AM/PM indicator.
Why is this? Is this a bug in snmpColDump? cron? environment? Is there
a way to force snmpColDump to output in 24-hour format?
Any insight would be greatly appreciated.
TIA
Mahesh
|