LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   OCS Inventory IP Address of Clients shows Blank on Web Page (https://www.linuxquestions.org/questions/linux-software-2/ocs-inventory-ip-address-of-clients-shows-blank-on-web-page-4175537702/)

Rohant 03-24-2015 08:19 AM

OCS Inventory IP Address of Clients shows Blank on Web Page
 
2 Attachment(s)
Hi All,

I have posted this query on OCS site but didnt get reply. so i thought some might have face this issue & guide me thats why i posted my query here.

I have setup OCS Inventory server 2.1 on Centos server 6.5 64bit OS. All the details is coming to my OCS server properly except IP Address of Client Machines.

Majority of my client is running with ocsinventory-agent-2.1.1-1. below is my configuration file (Client side) ocsinventory-agent.cfg.

#################

# Server URL, unconmment if needed
server=http://10.0.0.218:8082/ocsinventory
basevardir = /var/lib/ocsinventory-agent

# Administrative TAG (optional, must be filed before first inventory)
tag = Server

# How to log, can be File,Stderr,Syslog
logger = Stderr
logfile = /var/log/ocsinventory-agent/ocsinventory-agent.log

#################

Currently i am monitoring three subnet as mentioned below.

OCS_SERVER_IP = 10.0.0.218 (Inside DMZ)

1st subnet = 10.0.0.0 (Inside DMZ)

2nd subnet = 10.0.1.0 (Inside DMZ)

3rd subnet = 10.0.5.0 (Inside DMZ)

4th subnet = 192.168.1.0 (Outside DMZ)

When i execute manually "/usr/sbin/ocsinventory-agent" command the IP address of server gets displayed in "IP address" column. but after some time when other servers sends their inventory the ip addresses of earlier servers gets vanished from the column. it keeps vanished until i execute "/usr/sbin/ocsinventory-agent" command manually.

I have manually set a cronjobs for every 6 hours on clients to send inventory to server. when those crons gets runs even at that time IP address column shows blank but i can see in "Last inventory" column that inventory is just now.

Please guide me on the issue as i have tried almost all things but unable to find issue.

Attached is my Client side debug log file is very big.

If some had faced this issue or have some guidance please let me know.

Thanks in Advance...

carlwilson 04-08-2015 09:11 AM

I had the same problem and stumbled across your question whilst looking for an answer.

I did a bit more research. The answer is simple: the cron job doesn't know the path to ifconfig (usual problem with cron jobs). Solution is to enter the cron job as:

* */3 * * * . /etc/profile; /usr/local/bin/ocsinventory-agent > /dev/null 2 >&1


You can check this by running ocsinventory-agent --local=/tmp from the command line and then as the cron job.

From the command line (which has the correct path) you get the correct content; from the cron job (without the path) you get a blank <NETWORKS> section.

Rohant 04-29-2015 02:23 AM

Thanks carlwilson for your info. it solved my issue.

However when i ran "* */3 * * * . /etc/profile; /usr/local/bin/ocsinventory-agent > /dev/null 2 >&1" from cron it didnt worked. but when i ran ". /etc/profile; /usr/local/bin/ocsinventory-agent > /dev/null 2 >&1" from shell script it worked. so i am running that shell script from cron now.

Still not figured out why its not woking from cron directly.

Thanks once again for your Info.


All times are GMT -5. The time now is 08:52 PM.